strcat function in c code example
Example 1: 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;
}
Example 2: strstr in c
char *strstr(const char *haystack, const char *needle)
\\returns *needle if found, NULL if not