i before asked for help in my c++ problem and every one told me i have to do more effort so that might help me with it.
please guys here is what i have reached and note that i dont have the visual studio 6 on my pc.
i wrote this on text so check for me...but i cant write it with using splice() fuction or write list so help me with it plz....the program was :
Description:
Declare the following two integer lists:
int a[] = {5, 8, 4, 1, 7}, b[] = {12, 3, 15, 6, 23, 1, 2};
int sizeA = sizeof(a)/sizeof(int), sizeB = sizeof(b)/sizeof(int);
list<int> list1(a, a+sizeA), list2(b, b+sizeB);
Use the function splice() from the library "d_list1.h" to copy list2 onto the end of list1.
Use writeList() to output list1.
and that is all i can do:
#include<iostream.h>
main()
{
int a[]={5,8,4,1,7};
int b[]={12,3,15,6,23,1,2};
int i;
int sizeA,sizeB,temp;
for(i=0;i<5;i++)
{
temp=a[i];
sizeA=a[i]/2;
temp=temp+sizeA;
a[i]=temp;
}
for(i=0;i<5;i++)
{
temp=a[i];
sizeB=b[i]/2;
temp=temp+sizeB;
b[i]=temp;
}
"splice() as guessed
for(i=0;i<7;i++)
a[5+i]=b[i];
"write list() as i guessed
for(i=0;i<12;i++)
cout<<a[i];
}