Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- 3. Задать строку, скопировать в неё
- «James, while John had had "had", had had "had had"; "had had" had had a better effect on the teacher».
- (Примечание. Чтобы вставить кавычку посреди строки, её нужно экранировать: \".)
- Продемонстрировать работу функции strtok() с разными символами в качестве разделителя
- (пробелом, запятой, пробелом и запятой, точкой с запятой).
- */
- #include <stdio.h>
- #include <string.h>
- #define size 256u
- int main()
- {
- char arr[size] = { 0 };
- char* arr2 = "James, while John had had \"had\", had had \"had had\"; \"had had\" had had a better effect on the teacher";
- strcpy_s(arr, size, arr2);
- printf("%s\n", arr);
- char* token = strtok_s(arr, size, " "); // Error here.
- puts(token);
- printf("%s\n", arr);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement