| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 498 人关注过本帖
标题:菜鸟尴尬帖。求达人解释。
只看楼主 加入收藏
magina_hh
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2009-7-25
结帖率:80%
收藏
已结贴  问题点数:20 回复次数:4 
菜鸟尴尬帖。求达人解释。
/* Program 1.7 A longer program */
#include <stdio.h> /*Include the header file for input and output*/

int main(void)
{

    printf("Hi there!\n\n\nThis program is a bit");
    printf(" longer than the others.");
    printf("\nBut really it's only more text.\n\n\n\a\a");
    printf("Hey, wait a minute!! What was that???\n\n);
    printf("\t1.\tA bird?\n");
    printf("\t2.\tA plane?\n");
    printf("\t3.\tA control character? \n");
    printf("\n\t\t\b\bAnd how will this look when it prints out? \n\n");
    return 0;

}


这组代码。

编译的时候出现的错误为

c:\documents and settings\administrator\桌面\自学7.c(10) : error C2001: newline in constant
c:\documents and settings\administrator\桌面\自学7.c(11) : error C2146: syntax error : missing ')' before identifier 'printf'
执行 cl.exe 时出错.

换行符不断  还有缺少)

我检查了没有问题啊   请问我是哪里出错了?
搜索更多相关主题的帖子: 尴尬 解释 
2009-07-26 15:25
soler_z
Rank: 3Rank: 3
等 级:论坛游侠
帖 子:28
专家分:130
注 册:2009-7-17
收藏
得分:10 
少"了。
printf("Hey, wait a minute!! What was that???\n\n);
2009-07-26 15:35
magina_hh
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2009-7-25
收藏
得分:0 
回复 2楼 soler_z
谢谢。
2009-07-26 15:40
绿豆
Rank: 1
等 级:新手上路
帖 子:8
专家分:2
注 册:2009-7-25
收藏
得分:0 
我加上了 也不对 我好郁闷
2009-07-26 15:56
prankmoon
Rank: 8Rank: 8
等 级:蝙蝠侠
帖 子:161
专家分:921
注 册:2009-7-21
收藏
得分:10 
下面的代码在 VC6 下编译运行均正常:
程序代码:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void)
{

    printf("Hi there!\n\n\nThis program is a bit");
    printf(" longer than the others.");
    printf("\nBut really it's only more text.\n\n\n\a\a");
    printf("Hey, wait a minute!! What was that???\n\n");
    printf("\t1.\tA bird?\n");
    printf("\t2.\tA plane?\n");
    printf("\t3.\tA control character? \n");
    printf("\n\t\t\b\bAnd how will this look when it prints out? \n\n");
    return 0;

}

输出:
Hi there!


This program is a bit longer than the others.
But really it's only more text.


Hey, wait a minute!! What was that???

        1.      A bird?
        2.      A plane?
        3.      A control character?

And how will this look when it prints out?

不知道结果是不是你想要的?
2009-07-26 16:10
快速回复:菜鸟尴尬帖。求达人解释。
数据加载中...
 
   



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

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