Answers for "strstr in c"

C
4

string strcat function in c

#include <stdio.h>
#include <string.h>

int main() {
   char str1[100] = "This is ", str2[] = "A Name";

   // concatenates str1 and str2
   // the resultant string is stored in str1.
   strcat(str1, str2);

   puts(str1);
   puts(str2);

   return 0;
}
Posted by: Guest on July-09-2020
9

string in c

#include <stdio.h>

int main(void) {
  char name[] = "Harry Potter";

  printf("%c", *name);     // Output: H
  printf("%c", *(name+1));   // Output: a
  printf("%c", *(name+7));   // Output: o

  char *namePtr;

  namePtr = name;
  printf("%c", *namePtr);     // Output: H
  printf("%c", *(namePtr+1));   // Output: a
  printf("%c", *(namePtr+7));   // Output: o
}
Posted by: Guest on April-25-2020
3

strstr in c

char *strstr(const char *haystack, const char *needle)
\\returns *needle if found, NULL if not
Posted by: Guest on April-20-2021
2

what is stdin in c

//stdin accesses the keyboard, it's a file pointer
Posted by: Guest on February-07-2020

Code answers related to "C"

Browse Popular Code Answers by Language