注册 登录
编程论坛 VC++/MFC

麻烦老师,看一下这段vc++6代码,错在哪儿?

greenpop 发布于 2017-05-09 08:29, 3001 次点击
#include<stdio.h>

int main()
{
    int iNumber1=3;
    int iNumber2=3;

    int iResultPreA,iResultLastA;
    int iResultPreD,iResultLastD;

    iResultPreA=++iNumber1;
    iResultLastA=iNumber2++;

    printf("The Addself...\n");
    printf("the iNumber1 is :%d\n",iNumber1);
    printf("the iResultPreA is: $d\n",iResultPreA);
    printf("the iNumber2 is :$d\n",iNumber2);
    printf("the iResultLastA is:%d\n",iResultLastA);

    iNumber1=3;
    iNumber2=3;

    iResultPreD=--iNumber1;
    iResultLastD=iNumber2--;

    printf("The Deleteself...\n")
    printf("the iNumber1 is :%d\n",iNumber1);
    printf("the iResultPreD is :%d\n",iResultPreD);
    printf("the iNumber2 is :%d\n",iNumber2);
    printf("the iResultLastD is:%d\n",iResultLastD);

    return 0;

}
3 回复
#2
chinesecpp2017-08-10 17:08
少个分号
printf("The Deleteself...\n")
这句话少了
#3
农民工2017-09-21 14:28
楼主请学习下通过编译器的输出来查找问题
1>------ 已启动生成: 项目: es, 配置: Debug Win32 ------
1>  es.cpp
1>g:\mysql\es.cpp(31): error C2146: 语法错误: 缺少“;”(在标识符“printf”的前面)
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========
#4
ssl0022017-10-08 18:43
printf("The Deleteself...\n"),这里少一个分号。
1