错在哪了?怎么根据提示调试
#include<stdio.h>
#include<string.h>
#define LINE 5
#define SIZE 81
void sort_str(char * strings[],int num);
int main(void)
{
char input[LINE][SIZE];
int ct = 0;
int i;
char *ptstr[LINE];
printf("Input %d lines,and I will sort them.\n", LINE);
//输出输入字符串
while(ct < LINE && strcmp(gets(input[ct]), "") != NULL)//相等while(ct < LINE && gets(input[ct]) != NULL && input[ct][0] !='\0')
{
ct ++;
}
if(ct < LINE)
{
for(i = 0;i < ct; i++)
{
ptstr[ct] = input[ct];
puts(input[i]);
}
}
else
for(ct = 0; ct < LINE; ct++)
{
ptstr[ct] = input[ct];
puts(input[ct]);
}
printf("there are %d line.\n", ct);
printf("The sorted :\n");
sort_str(ptstr, ct);
return 0;
}
//排序
void sort_str(char * strings[],int num)
{
int i;
int j;
char *temp;
for(i = 0; i < num; i++)
for(j = i + 1; j < num ; j++)
if(strcmp(strings[i], strings[j]) >0)
{
temp = strings[j];
strings[j] = strings[i];
strings[i] = temp;
}
puts(strings[i]);
}哪里错了?出现“391.1.exe 中的 0x1022fb10 (msvcr80d.dll) 处未处理的异常: 0xC0000005: 读取位置 0xcccccccc 时发生访问冲突” 提示
还跳出
strlen.asm的文件是怎么回事?要怎么根据该文件修改?各位大哥帮帮忙啊