View Full Version : search for a string in c
alaios
07-07-2005, 11:38 PM
Hi i want to search for a specific word in a string.. How i can do this in c? Do u know where i can find some documentation about string handling in c language?
Have a nice day :)
nikkiH
07-08-2005, 04:43 PM
What flavor of C?
Standard ANSI C doesn't have strings. It has character arrays. You want to search, you write a function to do it.
C, C++, C# ...?
Microsoft or Unix?
Jason
07-08-2005, 08:06 PM
nikkiH: C = regular C, not C++ and not C#
alaios: just re-write your own string function in C, should be really close to that of C++, Im sure you could find the headers and function calls that the string function can make through a google search...
Search for strstr(), its an ANSI C function that is used to find a substring within a string.
nikkiH
07-11-2005, 03:59 PM
strstr() is ANSI C?
*smacks self*
Geez, I need to get out more.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.