Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. c

c

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Abijith N M
    wrote on last edited by
    #1

    why the function strstr used in C ?

    L M S J 4 Replies Last reply
    0
    • A Abijith N M

      why the function strstr used in C ?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      If you spend some time with the documentation[^] you will learn many useful features.

      One of these days I'm going to think of a really clever signature.

      1 Reply Last reply
      0
      • A Abijith N M

        why the function strstr used in C ?

        M Offline
        M Offline
        Maximilien
        wrote on last edited by
        #3

        why? Simply to search for a string in another string.

        Watched code never compiles.

        1 Reply Last reply
        0
        • A Abijith N M

          why the function strstr used in C ?

          S Offline
          S Offline
          Software_Developer
          wrote on last edited by
          #4

          strstr() finds a substring in a string. use it to search inside string elements.

          #include
          #include

          main()
          {
          char mainString[]="string to search";
          char strstr_sub_string_to_search[]="to";

          if ( strstr(mainString, strstr_sub_string_to_search)) puts("strstr() found Substring in main string\n");
          else puts("strstr() did not find Substring in main string\n");

          return 0;
          }

          1 Reply Last reply
          0
          • A Abijith N M

            why the function strstr used in C ?

            J Offline
            J Offline
            JohnAspras
            wrote on last edited by
            #5

            http://www.cplusplus.com/reference/clibrary/cstring/strstr/[^] Find a string within a string...

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups