lets say i got that inside a .cnf file on my mc. I open it up with fioOpen and now i want to read from it. I don't want to read the whole sentence but only a single character from it. So lets say i want to read the fifth character from the file. I this case it would be o. How can i do that?
You use a seek function to position the file pointer. Then use the read function to read just one byte. (Don't have the exact function names in front of me).
Generally though it would be easier to read the whole thing into memory and use memory access for individual characters.
unsigned char *data;
fd = fioOpen("mc0:/SYS-CONF/hello.cnf", O_RDONLY);
seek = fioLseek(fd, 0, SEEK_END); //but the zero here. what should i replace it with?
fioLseek(fd, 0, SEEK_SET);// same question here
fioRead(fd,data,seek);
fioClose(fd);
printf("the fifth byte is %d", data);
Remeber one thing there is no such thing as strings in C++ :D
And what does that mean? Strings exist as much as they do in C.
They are arrays of chars, not strings. And actually, strings exist more in C++ than in C, but the real problem is I don't think everyone in this thread understands that C and C++ are different languages.
I take that back, the real problem is that this is a very beginner programming thread on a much more specialized forum. This thread is only going to go no where, so I'm locking it.