i am trying to make an inventory programme. what i need to know
is how to search strings in a file so i can store information then retreive it later, if anyone knows how to do this that would be appreciated,
cheers
Printable View
i am trying to make an inventory programme. what i need to know
is how to search strings in a file so i can store information then retreive it later, if anyone knows how to do this that would be appreciated,
cheers
Read the file into a buffer
Lookup strstr()
This one was given by prelude
Code:const char *sub(const char *m, const char *s){
do {
const char *p, *q;
for (p = s, q = m; *p == *q; p++, q++)
if (*(q+1) == '\0') return s;
} while (*s++ != '\0');
return 0;
}