Can someone show me an example of strstr and/or strcasestr please? I'd like to use it to check for a certain number of letters after the specified number.
Code:example: 1 This would be the text I'm searching for 2 not this 3 not this
Can someone show me an example of strstr and/or strcasestr please? I'd like to use it to check for a certain number of letters after the specified number.
Code:example: 1 This would be the text I'm searching for 2 not this 3 not this
strstr(str1,str2) will return the index of the first occurance of str1 in str2, so if you wanted everything up to number 2 as in your example,
strstr(myCstring,2) will return the index of the number 2 in your string, thus you would take everything from 0 to the returned index - 1
In my program I'm using integers as the sign things, that won't work. Is there another function that uses numbers in the sameway this function uses letters?
do u want to find text after 1. and before 2.?
Yes, but the numbers change. So at one time it might be 1 and another it might be 3. So, I used an interval. How would I do that?
well how do u want the user to search
will he have any alternatives like the nr
or is he going to search for a string or character?
The user inputs text, the program checks every string after a certain number; checking for a match. Then the same integer is used on an output file. That string is taken and then printed onto the screen. I already have the basic program but I need a function for using integer variables as the signs.
You can make your own function and use it to search for a letter or a number in a file...
You characters in the file to a string and then, make a pointer to check each character...
Of you can do the checking using the get pointer of the file stream you are using...
none...