![]() |
|
#1
|
|||
|
|||
linked lists, newbie needs helprequired to write a c prog to display sine waves. the user inputs values for frequency, amplitude and phase. the values are stored in a linked list structure e.g
CPP / C++ / C Code:
user must be able to add waves, delete waves, edit the characteristics of a selected wave. the current wave and summation of all waves entered must be able to be displayed in graphics window when called upon,and must represent the contents of the linked list at all times..... help needed, this is a bit complicated for a newbie like myself!! any code or hints/pointers would be greatly appreciated........ i have attached what code i have assembled so far but help would be much appreciated.. Last edited by dsmith : 06-May-2004 at 08:15.
Reason: Please use [c] & [/c] for syntax highlighting
|
|
#2
|
||||
|
||||
|
Hi Moltarim. Welcome to GIDForums
First of all a quick question. Are you using word for an editor? I am not sure what advantages that is giving you, but the disadvantages are several, no highlighting and you need to convert it to a text file to compile. Just a question. Second. You should probably start by making sure you know exactly how to add and delete data from a linked list and make sure that it is working properly. It appears that you have copied code from a car search. It appears to be correct, but if you don't understand it 100% it may be more trouble to morph your program into this format. I would start out with a few simple functions just for testing purposes. This is a very simplified start to linking data. CPP / C++ / C Code:
I had most of the linked list stuff already implemented from other functions. I would do some testing with this and then add the stuff that you need as you are sure this works. Good luck, d Last edited by dsmith : 06-May-2004 at 09:20.
Reason: Added a little tighter error checking
|
|
#3
|
|||
|
|||
|
thanx very much man, ur help was greatly appreciated...... i'm using microsoft visual C++ by the way i just pasted the code into word so i could attach it. i'll go have some fun with ur code now. i could well be back for more advice though lol.
|
|
#4
|
||||
|
||||
|
Quote:
To attach a source file, either change the extention to .txt or zip it. It results in a much smaller file and is easier to manage. Also, make sure that you run through that code that I scrawled together. In just looking at it I noticed a major f' up: I am always deleting the first wave because of the assignment (=) instead of comparision operator (==). This CPP / C++ / C Code:
Should be changed to this: CPP / C++ / C Code:
Sorry. Anyway, I gave you the basics. You need to experiment with this and then add on the icing . |
|
#5
|
||||
|
||||
|
Quote:
I hate to whip a dead-horse, but I also don't like to post buggy code. This error actually will cause head drift and will abandon data. It sets the head to be at the current position every time. So every data entry prior to it is lost! Moltarim, I hope that you are reading this still . To quote one of the better movies of all time: "It is always the little things that get me" - Office Space, Michael Bolten. |
Recent GIDBlog
First week of IA training by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Merge sort on a linked list | Temujin_12 | CPP / C++ Forum | 1 | 06-Mar-2008 20:33 |
| Linked lists | vortz83 | CPP / C++ Forum | 3 | 20-Mar-2004 06:56 |
| newbie using Sam's series | Skampy | CPP / C++ Forum | 3 | 06-Mar-2004 18:51 |
| Problem with my Geforce video card | Shivs | Computer Hardware Forum | 2 | 30-Jan-2004 20:54 |
| Newbie needs help with "Permission denied" | charles | Apache Web Server Forum | 0 | 30-Jan-2004 15:08 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The