请问这个错误怎么改???
程序代码:
// 单元化字符串.cpp : 定义控制台应用程序的入口点。 // #define _STDC_WANT_LIB_EXT1_ 1 #include "stdafx.h" #include<stdlib.h> #include<string.h> #include <stdbool.h> int main() { char delimiters[] = "\".,;:!?)(";//确定定界符。 char buf[100];//键盘输入线的缓冲器 。 char str[1000];// char* ptr = NULL; size_t str_len = sizeof(str); size_t buf_len = sizeof(buf); printf("Enter some prose that less than %zd characters.\n" "Terminate input by entering an empty line:\n"str_len); while (ture) { if (!gets_s(buf, buf_len)) { printf("Error reading string.\n"); return 1; } if (!strnlen_s(buf, buf_len)) break; if (strcat_s(str, str_len, buf)) { printf("Mximum permitted input length exceeded.\n"); return; } } printf("the words in the prose that you entered are:\n", str);//找到并列出找到的所有词。 unsigned int word_count = 0; char * pWord = strtok_s(str, &str_len, delimiters, &ptr); if (pWord) { do { printf("%-18s", pWord); if (++word_count % 5 == 0) printf("\n"); pWord = strtok_s(NULL, &str_len, delimiters, &ptr); } while (pWord); printf("\n%u words found.\n", word_count); } else printf("No woeds found.\n"); system("pause"); return 0; } [local]1[/local]
和书上上一样的,难道时编译器问题?