![]() |
|
#1
|
|||
|
|||
SDL + Classes QuestionCPP / C++ / C Code:
I'm going to read in sprite.img from a file... The problem is that I will have to construct cSprite sprite before I can read in sprite.img which means that it will try to load a non-existant image... Would there by any easy way to read in sprite.img before having it try to load sprite.img? Or should I just change my constructor to something like init() then read in all my information, and then call that? |
|||
|
#2
|
|||
|
|||
|
...great.. I just lost everything I just typed. I hate browsers!
So yah.. no edit button huh? Or am I blind? I've come up with somewhat of a solution. I'm going to read the file in the constructor itself. But I'm having a dumb moment and I can't seem to figure out how to get it to read properly. Here's the contents of my file Code:
Basically I want it to search for the '$' character, then once it finds that, it reads in a string, ie, 'NAME' Once it finds 'NAME' it calls this function CPP / C++ / C Code:
to read in 'Angela' (the function just removes all the white spaces before it.. it works) And then it stops reading as soon as it gets to the next '$NAME'. I need it to leave the cursor just before '$NAME' so that when I call this function again, it continues where it left off.. reading in the next character. I assume I'll need to use something like fin.unget(). I've done stuff like this before, but I can't seem to get it to read properly at all this time. Any help would be appreciated.. CPP / C++ / C Code:
|
|
#3
|
|||
|
|||
|
CPP / C++ / C Code:
this will read name and image... but nothing else |
Recent GIDBlog
Accepted for Ph.D. program by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| A question about message forums... | Straga | Free Web Hosting | 2 | 07-Apr-2004 05:54 |
| question of practice | magiccreative | C++ Forum | 1 | 06-Feb-2004 08:17 |
| ClassView not showing my classes (VC++, namespace, headers) ?!?!? | djovanov | C++ Forum | 1 | 13-Jan-2004 05:54 |
| a C input question | tmike | C Programming Language | 1 | 16-Sep-2003 03:31 |
| a noobish compiler question | Charunks | C++ Forum | 5 | 03-Sep-2003 03:18 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The