Thread: how to see if one string is contained in the other

  1. #1
    Registered User
    Join Date
    Aug 2009
    Posts
    1

    Question how to see if one string is contained in the other

    hey guys, i have a question about writing a function where the user is prompted to input 2 strings, and "determine if the second is in the first."

    anybody have any ideas how one would go about doing this?

  2. #2
    Registered User GL.Sam's Avatar
    Join Date
    Aug 2009
    Posts
    88
    It's actually a standard function from string.h header.

    char *strstr(const char * s1, const char * s2);

    This function returns a pointer to the first occurrence of string s2 in string s1. The function returns the null pointer if the string is not found.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. OOP Question DB Access Wrapper Classes
    By digioz in forum C# Programming
    Replies: 2
    Last Post: 09-07-2008, 04:30 PM
  2. Message class ** Need help befor 12am tonight**
    By TransformedBG in forum C++ Programming
    Replies: 1
    Last Post: 11-29-2006, 11:03 PM
  3. Classes inheretance problem...
    By NANO in forum C++ Programming
    Replies: 12
    Last Post: 12-09-2002, 03:23 PM
  4. creating class, and linking files
    By JCK in forum C++ Programming
    Replies: 12
    Last Post: 12-08-2002, 02:45 PM
  5. Warnings, warnings, warnings?
    By spentdome in forum C Programming
    Replies: 25
    Last Post: 05-27-2002, 06:49 PM

Tags for this Thread