| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 466 人关注过本帖
标题:各位大虾帮忙看一下,这道程序出错在哪里
取消只看楼主 加入收藏
a654548060
Rank: 2
等 级:论坛游民
帖 子:18
专家分:10
注 册:2010-3-30
结帖率:100%
收藏
已结贴  问题点数:10 回复次数:1 
各位大虾帮忙看一下,这道程序出错在哪里
#include <iostream.h>
static string GetCustomerName(int);
void Call_GetCustomerName();
int main(void)
{
    Call_GetCustomerName();
    return 1;
}
void Call_GetCustomerName()
{
    cout<<GetCustomerName(125);
}
static string GetCustomerName(int customerId)
{
    string ret_name;
    if(customerId>=1&&customerId<=100)
    {
        ret_name="A Group";
    }
    else
    {
        ret_name="Unknow";
    }
    return ret_name;
}



Compiling...
Cpp1.cpp
C:\Documents and Settings\longtingwei\桌面\新建文件夹\Cpp1.cpp(3) : error C2146: syntax error : missing ';' before identifier 'GetCustomerName'
C:\Documents and Settings\longtingwei\桌面\新建文件夹\Cpp1.cpp(3) : fatal error C1004: unexpected end of file found
Error executing cl.exe.

Cpp1.obj - 2 error(s), 0 warning(s)

2010-06-12 22:12
a654548060
Rank: 2
等 级:论坛游民
帖 子:18
专家分:10
注 册:2010-3-30
收藏
得分:0 
回复 2楼 南国利剑
谢谢  我之前也加过#include<string.h>不过编译的时候显示不出来,我想问一下#include<string>和#include<string.h>有什么区别
2010-06-13 14:51
快速回复:各位大虾帮忙看一下,这道程序出错在哪里
数据加载中...
 
   



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

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