| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 645 人关注过本帖
标题:错在哪了?怎么根据提示调试
取消只看楼主 加入收藏
danaiyi
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2012-10-19
结帖率:100%
收藏
 问题点数:0 回复次数:0 
错在哪了?怎么根据提示调试
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
#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的文件是怎么回事?要怎么根据该文件修改?各位大哥帮帮忙啊
2012-10-20 21:39
快速回复:错在哪了?怎么根据提示调试
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.024498 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved