C++语言 简单错误

[复制链接]
查看11 | 回复3 | 2010-9-21 14:27:39 | 显示全部楼层 |阅读模式
#include "stdafx.h"
#include
using namespace std;
class A
{

int a;

int b;
public:

void c()

{

cout << "111111111" << endl;

}

void c(int x)

{

cout << "22222222" << endl;

}
};
int main()
{


A q;

q.c();
如何调用 222222222222

void c(int x)

{

cout << "22222222" << endl;

}

回复

使用道具 举报

千问 | 2010-9-21 14:27:39 | 显示全部楼层
q.c(1);1可改为其他int型数
回复

使用道具 举报

千问 | 2010-9-21 14:27:39 | 显示全部楼层
#include using namespace std;class A{
int a;
int b;public:
void c()
{
cout << "111111111" << endl;
}
void c(int x)
{
回复

使用道具 举报

千问 | 2010-9-21 14:27:39 | 显示全部楼层
传一个int 参数就好了.q.c(1);
回复

使用道具 举报

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

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行