“!=”:“int”与“void *”的间接级别不同
程序代码:#include<stdio.h>
#include<string.h>
#define SIZE 81
#define LIM 20
#define HALT " "
void stsrt(char *strings[], int num);
int main(void)
{
char input[LIM][SIZE];
char *ptstr[LIM];
int ct = 0;
int k;
printf("Iput up to %d lines,and I will sort them,\n", LIM);
printf("To stop press the Enter key at a line`s start.\n");
while(ct< LIM && gets(input[ct]) != NULL && input[ct][0] != '\0')
{
ptstr[ct] = input[ct];
ct++;
}
ststr(ptstr, ct);
puts("\nHere`s the sorted list:\n");
for (k = 0;k < ct;k++)
puts(ptstr[k]);
system("pause");
return 0;
}
//字符串-指针-排序函数
void stsrt(char *strings[], int num)
{
char *temp;
int top, seek;
for(top=0;top<num-1;top++)
for(seek=top+1;seek<num;seek++)
if(strcmp(strings[top], strings[seek]) > 0)
{
temp = strings[top];
strings[top] = strings[seek];
strings[seek] = temp;
}
}
1>------ 已启动生成: 项目: 字符串排序, 配置: Debug Win32 ------1> 11.25.c
1>d:\编程文件\c primer plus\字符串排序\字符串排序\11.25.c(17): warning C4013: “gets”未定义;假设外部返回 int
1>d:\编程文件\c primer plus\字符串排序\字符串排序\11.25.c(17): warning C4047: “!=”:“int”与“void *”的间接级别不同
1>d:\编程文件\c primer plus\字符串排序\字符串排序\11.25.c(22): warning C4013: “ststr”未定义;假设外部返回 int
1>d:\编程文件\c primer plus\字符串排序\字符串排序\11.25.c(27): warning C4013: “system”未定义;假设外部返回 int
1>11.25.obj : error LNK2019: 无法解析的外部符号 _ststr,该符号在函数 _main 中被引用
1>D:\编程文件\c primer plus\字符串排序\Debug\字符串排序.exe : fatal error LNK1120: 1 个无法解析的外部命令
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========
书上的原码,在vs2015上运行就出现这两个错误,求解答









