| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 4278 人关注过本帖
标题:新手求助,程序编译没有错误,运行之后出现tempfilr.exe程序出错,不知道该 ...
只看楼主 加入收藏
槑槑
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2016-5-28
收藏
 问题点数:0 回复次数:0 
新手求助,程序编译没有错误,运行之后出现tempfilr.exe程序出错,不知道该怎么改
程序编译没有错误,运行之后出现tempfilr.exe程序出错是为什么啊,该怎么改
#include <iostream>
using namespace std;
int main()
{
    void sort(char(*p)[5]);
    int i;
    char str[10][5];
    char (*p)[5];
    cout<<"input 10 strings:"<<endl;
    for(i=0;i<10;i++)
      cin>>str[i];
    p=str;
    sort(p);
    cout<<"the sequence is:"<<endl;
    for(i=0;i<10;i++)
    cout<<str[i]<<endl;
    return 0;
}

void sort(char(*s)[5])
{
    int i,j;
    char temp[5],*t=temp;
    for(i=0;i<9;i++)
      for(j=0;j<9-i;j++)
      if(strcmp(s[j],s[j+1])>0)
      {
          strcpy(t,s[j]);
          strcpy(s[j],s[+j+1]);
          strcpy(s[j+1],t);
      }
}
   
搜索更多相关主题的帖子: sequence return include 
2016-05-28 15:01
快速回复:新手求助,程序编译没有错误,运行之后出现tempfilr.exe程序出错,不知 ...
数据加载中...
 
   



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

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