| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 484 人关注过本帖
标题:为什么运行内存出现错误
只看楼主 加入收藏
给力小青年
Rank: 1
等 级:新手上路
帖 子:40
专家分:0
注 册:2011-11-20
结帖率:78.57%
收藏
已结贴  问题点数:10 回复次数:3 
为什么运行内存出现错误
程序代码:
#include "stdafx.h"
#include<stdio.h>
#define MSG "You must have many talents .Tell me sonme "
#define LIM 5
#define LINELEN 81
int main(void)
{
    char name[LINELEN];
    char talents[LINELEN];
    int i;
    const char m1[40] = "Limeit yoursekf to one line s worth.";
    const char m2[] = "If you cant think of anyting fake it .";
    const char *m3 = "\nEnough about me - what your name?";
    const char *mytal[LIM] = {"adding numbers swiftly",
    "Mul tiplting accurayely","stashing data"
    "pollowing insreuctiongs to the leetter",
    "Understanding the c language"};
    printf("Hi!i m clyde the computer", "i have many talents.\n");
    printf("let me tell you some of them .\n");//21
    puts("What wear they ? Ah yes here a partual list,");//22
    for(i = 0; i < LIM; i++)//23
        puts(mytal[i]);//24
    puts(m3);//25
    gets(name);//26
    printf("well %s, %s\n", name, MSG);
    printf("%s\n%s\n", m1, m2);
    printf(talents);
    printf("let s see if i cs gor that list:");
    puts(talents);
    printf("Thanks for the informatlos: %s.\n", name);
    getchar();
    return 0;
}
搜索更多相关主题的帖子: 内存 
2011-12-23 23:24
embed_xuel
Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19
等 级:贵宾
威 望:58
帖 子:3845
专家分:11385
注 册:2011-9-13
收藏
得分:5 
回复 楼主 给力小青年
constchar*mytal[LIM] = {"adding numbers swiftly","Mul tiplting accurayely","stashing data""pollowing insreuctiongs to the leetter","Understanding the c language"};
少了个逗号吧

总有那身价贱的人给作业贴回复完整的代码
2011-12-23 23:31
共和国鹰派
Rank: 3Rank: 3
来 自:山东
等 级:论坛游侠
帖 子:37
专家分:119
注 册:2011-10-20
收藏
得分:5 
哪里报错?报的什么错误?
2011-12-23 23:31
embed_xuel
Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19
等 级:贵宾
威 望:58
帖 子:3845
专家分:11385
注 册:2011-9-13
收藏
得分:0 
printf(talents);
数组talents没初始化直接打印也不对

总有那身价贱的人给作业贴回复完整的代码
2011-12-23 23:32
快速回复:为什么运行内存出现错误
数据加载中...
 
   



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

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