![]() |
|
#11
|
|||
|
|||
Re: Linked Lists advice requestalright,
I've scrapped most of it and started again. I've got a problem with my double-linked lists Code:
I'm getting this set off errors (colour coded): Quote:
the last one on line 266 is just the very last one of these "}" Is that better? cheers for all your help! |
|||
|
#12
|
|||
|
|||
Re: Linked Lists advice requestQuote:
Quote:
I pasted the code of your most recent post below. I removed the markups and put it between [c]...[/c] tags instead of [code]...[/code] tags: CPP / C++ / C Code:
You can see from the syntax highlighter that it can't possibly give any of the symptoms that you have described. This is impossibly wrong. I'm sorry that I can't help. Since you haven't posted the code that you are currently using, how the heck could you expect meaningful help from an outsider? Regards, Dave |
|
#13
|
|||
|
|||
Re: Linked Lists advice requestQuote:
One last time: If you are going to expect meaningful help, I think you should post the code that you are actually running. Or, at least, indicate somewhere in your post what line numbers of the code that you show us correspond to error messages. Here are the proper declarations for the structs that you showed: CPP / C++ / C Code:
Note that I have posted a complete program that you can compile and verify proper syntax before getting to the "good stuff." The dummy main() is there just so that it can get a complete compilation. That is: the typedefs are correct, and you can actually declare variables of these types. All brackets are matched so that you don't have the 'unexpected end of file' error. I respectfully suggest that you can do the same when building a program. Put new stuff in a little at a time. Compile. Make absolutely sure that there are no compiler errors or warnings before putting going on to the next step. Don't put in dozens of lines or hundreds of lines between compiles. Just put typedefs or functions or some such thing and do a compile. Regards, Dave |
|
#14
|
|||
|
|||
Re: Linked Lists advice requestsorry,
I'm just trying my best to give what I'm asked for. I am dyslexic, perhaps I misread or misinterpreted something (or take things too literally): it does often happen. (It certainly makes coding tricky - i missed that extra semi-colon I'd stuck into that structure) Correct, the error messages are not for the complete code i listed at the start of the thread - I took HowardL literally and just posted exactly what I thought he asked for. Apologies for the confusion; and thanks for your efforts. I've scrapped much of the previous code, and what I have now is shorter and clearer I think. I'm using a linked list vector line drawing prog I wrote (that I know works) as the basis for this prog. (I appreciate your methodical approach, and I'll do my best to get my head into it). I'll just post this; test yours; and post back in a sec'. This is the code I have right now: CPP / C++ / C Code:
|
|
#15
|
|||
|
|||
Re: Linked Lists advice requestSo I just ran your code
CPP / C++ / C Code:
...and got these two errors: Quote:
I understand what you're doing there... declaring some shapes that'll use these two structures... but I don't see why it's flagging up errors. |
|
#16
|
|||
|
|||
Re: Linked Lists advice requestQuote:
However, to get an absolutely clean compile, try this: CPP / C++ / C Code:
Once you have determined that the typedefs work this way, and once you have an absolutely clean compile (no warnings; no errors), then build up your program by adding a little at a time. Regards, Dave |
|
#17
|
|||
|
|||
Re: Linked Lists advice requestnot so clean apparently...
Quote:
|
|
#18
|
|||
|
|||
Re: Linked Lists advice requestThis is an entirely different programme, but it's the one I'm using as my basic model to develop from.
It compiles without any errors or warnings on my compiler - does it help? CPP / C++ / C Code:
|
|
#19
|
|||
|
|||
Re: Linked Lists advice requestQuote:
Maybe using sizeof() was a bad example, since it is evaluated at compile time. Some compilers create the code first and then look for references later. Try this to get a clean compile (no warnings whatsoever). Then go forward. CPP / C++ / C Code:
Output: Code:
Regards, Dave |
|
#20
|
|||
|
|||
Re: Linked Lists advice requestLong time no see!
Quote:
...cheers mate have one o' these on me; "http://www.e-pint.com/sample.php" Can I just ask though, is my approach to the shape drawing and rotation sound/sensible at a glance? (Obviously I'll plug each bit in and see, but I don't know anyone who seems to know) does this make sense as a way to use the structures as defined above to get data that draws the shapes? (the x, y, and "size" is a user input integer) CPP / C++ / C Code:
and one of the rotation approaches is supposed to be along the same lines, but I've commented it out in favour of what looks like a simpler one CPP / C++ / C Code:
|
Recent GIDBlog
Toyota - 2009 May Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| triangle (polygon), drawing, sizing, and rotation programme using linked lists... | promsan | C Programming Language | 12 | 14-May-2007 15:03 |
| Doubly linked lists in C++ | sweeeeeeetlipss | C++ Forum | 1 | 24-Oct-2006 00:27 |
| [Include] Doubly-linked List | dsmith | C Programming Language | 6 | 14-Apr-2006 14:12 |
| help on linked lists any1????? | nick4 | C Programming Language | 1 | 17-May-2004 10:32 |
| linked lists, newbie needs help | moltarim | C Programming Language | 4 | 06-May-2004 12:32 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The