#include <iostream.h>class C {
public :
int x;
void print() { cout<<x<<endl;}
}int main()
{
C counter, *counterptr = &counter, &counterref = counter;
counter.x = 7;
counter.print(); counterref.x = 8;
counterref.print(); counterptr->x = 10;
counterptr->print();
return 0;}
public :
int x;
void print() { cout<<x<<endl;}
}int main()
{
C counter, *counterptr = &counter, &counterref = counter;
counter.x = 7;
counter.print(); counterref.x = 8;
counterref.print(); counterptr->x = 10;
counterptr->print();
return 0;}
解决方案 »
- 注册表操作 为什么VS2010下测试不成功
- CListView create函数问题
- 如何在对话框上分别显示两张图片
- 怎样窗体吸附?
- 画布所在的区域会闪烁 不知道该怎么解决 ??
- 哪有无界面的安装WINPCAP的程序了?
- vc的高手救命阿!!请问有什么工具能快速删掉asp程序或vb程序或存储过程的注释
- error C2504: 'CAsyncSocket' : base class undefined
- vc里面如何实现tanα函数的功能(正切函数)
- MFC Socket 编程(发生了缓冲区溢出)
- 创建botton出错?!纳闷!!
- 在VC中调用C写的函数,调用函数后不能再写其他的代码,不知是什么错!(500分)
#include <iostream.h>class C {
public :
int x;
void print() { cout<<x<<endl;}
};int main()
{
C counter, *counterptr = &counter, &counterref = counter;
counter.x = 7;
counter.print(); counterref.x = 8;
counterref.print(); counterptr->x = 10;
counterptr->print();
return 0;}
public :
int x;
void print() { cout<<x<<endl;}
}; //少了分号