Answers for "strstr in cpp"

C++
19

string in cpp

// Include the string library
#include <string>

// Create a string variable
string greeting = "Hello";
Posted by: Guest on October-01-2020
0

use of strstr in c++

/* strstr example */
#include <stdio.h>
#include <string.h>

int main ()
{
  char str[] ="This is a simple string";
  char * pch;
  pch = strstr (str,"simple");
  strncpy (pch,"sample",6);
  puts (str);
  return 0;
}
Posted by: Guest on June-29-2020

Browse Popular Code Answers by Language