C++函数中数字符组做参数出错,请帮看看错在哪里

[复制链接]
查看11 | 回复2 | 2011-7-14 16:59:50 | 显示全部楼层 |阅读模式
代码如下:
#include
using namespace std;
void Accept(char &,int*, float &);
void Display(char,int,float);
int main()
{
        char cName[20];
        int iAge;
        float fSalary;
        Accept(cName[20],&iAge,fSalary);
        Display(cName[20],iAge,fSalary);
        return 0;
}
void Accept(char &nam,int* age_ptr,float&sal)
{
        cout>nam;
        cout>*age_ptr;
        cout>sal;
}
void Display(char nam[],int age,float sal)
{
        cout>nam;cout<<"请输入年...
回复

使用道具 举报

千问 | 2011-7-14 16:59:50 | 显示全部楼层
请输入名字:
ertert请输入年龄
33请输入月薪:
4444-----显示个人信息-----职员的名字是:e职员的年龄是:33职员的月薪是:4444Press any key to continue#includeusing namespace std;...
回复

使用道具 举报

千问 | 2011-7-14 16:59:50 | 显示全部楼层
#includeusing namespace std;void Accept(char &,int*, float &);void Display(char,int,float);int main(){char cName[20];int iAge;float fSalary;Accept(cName,&...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行