hi all

am having hard times since yesterday trying to solve this problem.

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.


Please help me guys i must have it in saturday class....tommorow.......in class they give assigments but they dont give knowlege

Read this first.

Dear Sir

they really didnt give us the knowlege to do such code

i will appreciate u will give me the knowlege on how to start so i dont need to ask some one to solve me my homework again........i really wanna be a proggramer........but they are not giving us the chance in here

Hello,

I suggest that you talk to your Dean at your college then, as I am sure you have already gone to your professor and asked questions in class. If the Dean is unresponsive, then you are not getting your money's worth at your institution.

Coding C++ requires knowledge of the header files, and you did not post them. The best we could do is guess, and that is a waste of everyone's time.

Please post to us what you have come up with so far for code. If you don't have any code to speak of, then there are larger issues. People here will help with syntax and design flow, but will not complete the project for you. It would not be ethical for you to hand it in as your own work.

Christian

hi all

am having hard times since yesterday trying to solve this problem.

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.


Please help me guys i must have it in saturday class....tommorow.......in class they give assigments but they dont give knowlege

Looks like you are supposed to use two STL list containers, load them with the a and b array, and then merge them with the splice() function. Simple stuff, but maybe a little early in your lessons.

Looks like you are supposed to use two STL list containers, load them with the a and b array, and then merge them with the splice() function. Simple stuff, but maybe a little early in your lessons.

i tried to and here is what i have reached

#include<iostream.h>
main()
{

int a[] = {5, 8, 4, 1, 7};
int b[] = {12, 3, 15, 6, 23, 1, 2};
int sizeA = sizeof(a)/sizeof(int);
int sizeB = sizeof(b)/sizeof(int);


then what will i do i cant under stand the meaning of list<int> and the concept of merging them toghether.

Looks like you are supposed to use two STL list containers, load them with the a and b array, and then merge them with the splice() function. Simple stuff, but maybe a little early in your lessons.

and how can i use library "d_list1.h" to copy lists

well, there's probably a function in there that you can use.
But as noone here except maybe you (and I doubt you took the trouble...) has ever seen it we're not going to be able to help you further.

Do your own homework and do your own THINKING. Way too many kids come here expecting to be turned into programming gurus by simply copying sourcecode produced by others and never having to exercise their brains.

Take a look at the code snippet called "Experimenting with the STL list" here on DaniWeb at:
http://www.daniweb.com/code/snippet100.html
This tells you about the concept of the list. It actually has just about the answer, but you have to figure it out yourself!

Clue: check the true meaning of sizeA and sizeB

This question has already been answered. Start a new discussion instead.