| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 821 人关注过本帖
标题:error C2017 C2001等求助
取消只看楼主 加入收藏
熙仔轩
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2009-7-28
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:1 
error C2017 C2001等求助
#include<iostream>

int Double(int);
long Double(long);
float Double(float);
double Double(double);

using namespace std;

int main()
{
    int myInt=6500;
    long myLong=65000;
    float myFloat=6.5F;
    double myDouble=6.6e20;

    int doubledInt;
    long doubledLong;
    float doubledFloat;
    double doubledDouble;

    cout<<"myInt: "<<myInt<<"\n";
    cout<<"myLong: "<<myLong<<"\n";
    cout<<"myFloat: "<<myFloat<<"\n";
    cout<<"myDouble: "<<myDouble<<"\n";
    
    doubledInt=Double(myInt);
    doubledLong=Double(myLong);
    doubledFloat=Double(myFloat);
    doubledDouble=Double(myDouble);

    cout<<"doubledInt: "<<doubledInt<<"\n";
    cout<<"doubledLong: "<<doubledLong<<"\n";
    cout<<"doubledFloat: "<<"doubledFloat<<"\n";
    cout<<"doubledDouble: "<<"doubledDoule<<"\n";

    return 0;
}

int Double(int original)
{
    cout<<"In Double(int)\n";
    return 2*original;
}

long Double(long original)
{
    cout<<"In Double(long)\n";
    return 2*original;
}

float Double(float original)
{
    cout<<"In Double(float)\n";
    return 2*original;
}

double Double(double original)
{
    cout<<"In Double(double)\n";
    return 2*original;
}


错误
--------------------Configuration: hello1 - Win32 Debug--------------------
Compiling...
hello1.cpp
C:\Program Files\Microsoft Visual Studio\MyProjects\hello1\hello1.cpp(34) : error C2017: illegal escape sequence
C:\Program Files\Microsoft Visual Studio\MyProjects\hello1\hello1.cpp(34) : error C2001: newline in constant
C:\Program Files\Microsoft Visual Studio\MyProjects\hello1\hello1.cpp(34) : error C2146: syntax error : missing ';' before identifier 'n'
C:\Program Files\Microsoft Visual Studio\MyProjects\hello1\hello1.cpp(34) : error C2065: 'n' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\MyProjects\hello1\hello1.cpp(34) : error C2143: syntax error : missing ';' before 'string'
C:\Program Files\Microsoft Visual Studio\MyProjects\hello1\hello1.cpp(35) : error C2146: syntax error : missing ';' before identifier 'cout'
C:\Program Files\Microsoft Visual Studio\MyProjects\hello1\hello1.cpp(35) : error C2017: illegal escape sequence
C:\Program Files\Microsoft Visual Studio\MyProjects\hello1\hello1.cpp(35) : error C2001: newline in constant
C:\Program Files\Microsoft Visual Studio\MyProjects\hello1\hello1.cpp(35) : error C2146: syntax error : missing ';' before identifier 'n'
C:\Program Files\Microsoft Visual Studio\MyProjects\hello1\hello1.cpp(35) : error C2143: syntax error : missing ';' before 'string'
C:\Program Files\Microsoft Visual Studio\MyProjects\hello1\hello1.cpp(37) : error C2143: syntax error : missing ';' before 'return'
执行 cl.exe 时出错.

hello1.exe - 1 error(s), 0 warning(s)
搜索更多相关主题的帖子: include double 
2009-08-05 13:33
熙仔轩
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2009-7-28
收藏
得分:0 
谢谢啊
2009-08-06 23:28
快速回复:error C2017 C2001等求助
数据加载中...
 
   



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

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