1#include <stdio.h>
2#include <string.h>
3
4int main() {
5 char str1[100] = "This is ", str2[] = "A Name";
6
7 // concatenates str1 and str2
8 // the resultant string is stored in str1.
9 strcat(str1, str2);
10
11 puts(str1);
12 puts(str2);
13
14 return 0;
15}
1#include <stdio.h>
2
3int main(void) {
4 char name[] = "Harry Potter";
5
6 printf("%c", *name); // Output: H
7 printf("%c", *(name+1)); // Output: a
8 printf("%c", *(name+7)); // Output: o
9
10 char *namePtr;
11
12 namePtr = name;
13 printf("%c", *namePtr); // Output: H
14 printf("%c", *(namePtr+1)); // Output: a
15 printf("%c", *(namePtr+7)); // Output: o
16}
1char *strstr(const char *haystack, const char *needle)
2\\returns *needle if found, NULL if not