I'm a novice in C. I would like to ask the ff:

  1. what is the return value of strstr function?
  2. Is there a substring function in Turbo C where you specify the string, the length of string to extract and the starting position?
  3. For instance, I have a char var TEMP, I'm storing letters I got from a loop. How do I initialize TEMP to return it back to NULL. I used TEMP=NULL but seems not working.

Please advice. Many thanks.


1) See This
2) Not really. Since you know the start and length, you can easily copy the string out. The function strncpy can do it if you understand derefrencing and indexing.
3) temp[0] = '\0'; -- you set the first entry to 0.