![]() |
|
#11
|
|||
|
|||
Re: runtime error R6002ok the next step in my assignment is to convert the program to use a linked list, ive been looking at linked lists all day and all i know is that i dont know squat! (and that my head hurts)
ive changed the struct to: CPP / C++ / C Code:
so now im trying to convert this lump of program to use linked lists instead CPP / C++ / C Code:
do you know of any good examples of this or can you set me off in the right direction? thanks mick |
|||
|
#12
|
||||
|
||||
Re: runtime error R6002 Walt. I tried to be simple.
The OP is already confused with other things. ![]() Mick, This: CPP / C++ / C Code:
CPP / C++ / C Code:
Since understanding linked lists is important , read this tutorial about linked lists and then, you will be able to write the code. If you have any doubts, feel free to ask. Linked List Basics Regards, ![]() Paramesh. __________________
Don't walk in front of me, I may not follow. Don't walk behind me, I may not lead. Just walk beside me and be my friend. Last edited by Paramesh : 23-Nov-2005 at 21:27.
|
|
#13
|
||||
|
||||
Re: runtime error R6002Quote:
Sure, I understand that. But to give help using a dangerous function is not a good idea. What happens when a confused poster takes your advice, creates a 2 char buffer for a name (first and last) and enters "Edmund Jackson" and wonders why the program explodes? fgets() is safe, and it seems the poster didn't even know sscanf() in the first place. __________________
During the election they said Obama could only be elected when pigs fly. Well, we currently have an epidemic of Swine Flu. Coincidence? |
|
#14
|
|||
|
|||
Re: runtime error R6002hey, really good link but im running into the same wall that i was banging my head against yesterday
the example it gives is CPP / C++ / C Code:
but if im reading this right, i want to replace the last line: node_ptr -> data = data_to_be_stored with a way to read the line from my file rather than input the values one by one. am i getting warm, or just talking s*%t? |
|
#15
|
||||
|
||||
Re: runtime error R6002Quote:
For example, like this: CPP / C++ / C Code:
Here is a simple explanation of linked list: Building a Linked List in C Paramesh. __________________
Don't walk in front of me, I may not follow. Don't walk behind me, I may not lead. Just walk beside me and be my friend. |
|
#16
|
|||
|
|||
Re: runtime error R6002thanks paramesh,
ive built the program as best i can but i think i might have messed up the loops a bit CPP / C++ / C Code:
Im currently getting a syntax error missing ;before { at this point: CPP / C++ / C Code:
and also 'malloc' undefined; assuming extern returning int |
|
#17
|
||||
|
||||
Re: runtime error R6002I already told you that you should use printf instead of fprintf(stdout.
and you should include your stdlib.h to use malloc. Your code is totally confusing. Just try a simple code first, and then once you satisfy with your simple one, switch to your main code. Here are some few changes you should make: In the printf statement, you should not put the & symbol. (I wonder you know printf statement CPP / C++ / C Code:
The syntax error came because: You use do while loop. You should end the while statement with a semicolon. There is no need for printing the output there. Just remove those lines. So, this: CPP / C++ / C Code:
should be changed to : CPP / C++ / C Code:
Now you must've understood what a linked list is! So, as already said, visit this simple linked list example: Linked List using C and proceed. Take a look at this program and you may find some hints: CPP / C++ / C Code:
Paramesh. __________________
Don't walk in front of me, I may not follow. Don't walk behind me, I may not lead. Just walk beside me and be my friend. |
|
#18
|
|||
|
|||
Re: runtime error R6002Please any1 help me.Where can I put the codes you tell.I really don't know very well to work with this stuff.I have the same problem as some of you guys do.Please help.
|
|
#19
|
|||
|
|||
Re: runtime error R6002Quote:
2. At the top of the list of threads, there is a link highlighted in red. The link is called "Read This >>>Guidelines for posting requests for help" Click on that one. Maybe there are enough specifics to help. If so, then quit reading this and create your own new thread. If you are still not sure... 3. Now, back at the "C Programming Language" site, just above the list of threads there is a button called "New Thread" Click on that one and an edit window opens. 4. Put your questions or other narrative in the edit window. Just type the stuff into the window.. 5. If you have code that is part of your post, then paste it from your text editor into the edit window. 6. Put [c] before the first line of the code. (The code, not the narrative.) 7. Put [/c] after the last line of the code. 8. Click on the "Preview Post" button below the edit window to see what it will like. 9. If it doesn't look the way you want it to look, then make changes in the edit window and click the "Preview Post" button again. 10. Repeat step 9 as many times as you need in order to make it look OK. Then, and only then, click the "Submit Reply" button. 11. Now go back and read the "Guidelines for posting requests for help" stuff again as you are waiting to see if anyone responds. Sometimes you get immediate help, sometimes it takes a while. It's an open forum and anyone can post. Maybe you will see a helpful response and maybe not. If your questions are specific and they are appropriate for a programming help forum, you will probably see some answer(s). Regards, Dave |
Recent GIDBlog
Programming ebook direct download available by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| runtime, compile time... | kai85 | C Programming Language | 2 | 19-May-2005 23:05 |
| Cannot find a runtime error on a fltk app running on windows | Frangar | FLTK Forum | 2 | 12-May-2005 12:38 |
| how to increase the font size at runtime | banur22 | MS Visual C++ / MFC Forum | 1 | 21-Apr-2005 07:37 |
| Free copy of Runtime Revolution | crystalattice | Open Discussion Forum | 0 | 29-Dec-2004 16:52 |
| Problem with php/mysql script during runtime | norok | MySQL / PHP Forum | 3 | 25-Jun-2003 06:35 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The