| View previous topic :: View next topic |
| Author |
Message |
JorDy
Joined: 11 Dec 2005 Posts: 121
|
Posted: Tue May 16, 2006 5:06 am Post subject: reading a file line at a time? and strtok() |
|
|
| Hey i just decided to start deving for the psp aswell now and i am having difficulties... Is there anyway i can read line line at a time from a file? l am also having dificulty using strtok(). the compiler wont recognise it it throws out the undefined reference to "strtok"error, oh and i have included string.h |
|
| Back to top |
|
 |
Gary13579
Joined: 15 Aug 2005 Posts: 93
|
Posted: Tue May 16, 2006 1:17 pm Post subject: |
|
|
typing in "man fgets" in bash should solve the first problem.
If you use the sceIo* functions, it will be a bit harder. You could read the file in a few bits at a time and check them to see if a \n is found, or you could read in the entire file and then loop through it and do something everytime a \n is found.
No clue what strtok is, so I can't help you there. |
|
| Back to top |
|
 |
dot_blank

Joined: 28 Sep 2005 Posts: 498 Location: Brasil
|
Posted: Tue May 16, 2006 1:52 pm Post subject: |
|
|
char *strtok( char *str1, const char *str2 );
found in string.h has he said above :P
basically what it does is break the string in *str1
into substrings (tokens ;) delimited by any of the
characters found in *str2 _________________ 10011011 00101010 11010111 10001001 10111010 |
|
| Back to top |
|
 |
JorDy
Joined: 11 Dec 2005 Posts: 121
|
Posted: Tue May 16, 2006 5:19 pm Post subject: |
|
|
| yeah i know what it does thatnks fr the help |
|
| Back to top |
|
 |
|