954,499 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

C++ help ,am new to C++ ,PLZ Help ASAP

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 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

helmica
Newbie Poster
5 posts since Feb 2005
Reputation Points: 10
Solved Threads: 0
 

Read this first.

frrossk
Posting Whiz in Training
220 posts since Sep 2004
Reputation Points: 17
Solved Threads: 9
 
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

helmica
Newbie Poster
5 posts since Feb 2005
Reputation Points: 10
Solved Threads: 0
 

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

kc0arf
Posting Virtuoso
Team Colleague
1,937 posts since Mar 2004
Reputation Points: 121
Solved Threads: 57
 

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 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.

vegaseat
DaniWeb's Hypocrite
Moderator
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
 
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
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 and the concept of merging them toghether.

helmica
Newbie Poster
5 posts since Feb 2005
Reputation Points: 10
Solved Threads: 0
 
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

helmica
Newbie Poster
5 posts since Feb 2005
Reputation Points: 10
Solved Threads: 0
 

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.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

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

vegaseat
DaniWeb's Hypocrite
Moderator
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You