又出错了,我又厚着脸来请教了
程序代码:#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
#define LIMIT 80
void ToUpper(char *);
int PunctCount(const char*);
int mian(void)
{
char line[LIMIT];
puts("Please enter a line:");
gets(line);
ToUpper(line);
puts(line);
printf("That line has %d punctuation characters.\n", PunctCount(line));
system("pause");
return 0;
}
void ToUpper(char * str)
{
while (*str)
{
*str = toupper(*str);
str++;
}
}
int PunctCount(const char *str)
{
int ct = 0;
while (*str)
{
if (ispunct(*str))
ct++;
}
return ct;
}1>------ 已启动生成: 项目: U, 配置: Debug Win32 ------
1> YT TR.c
1>d:\编程文件\c primer plus\u\u\yt tr.c(14): warning C4013: “gets”未定义;假设外部返回 int
1>MSVCRTD.lib(exe_main.obj) : error LNK2019: 无法解析的外部符号 _main,该符号在函数 "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ) 中被引用
1>D:\编程文件\c primer plus\U\Debug\U.exe : fatal error LNK1120: 1 个无法解析的外部命令
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========









