郁金香 中级班 1.c++的类和对象
#include<stdio.h> class 生物 { public: 生物() { printf("我是构造函数\n"); } int id1; int id2; float x; float y; void mov() { printf("我是这个类的对象函数\n"); } }; int main() { 生物 a; a.id1 = 3; a.mov(); return 0; }
本文来自博客园,作者:逆向狗,转载请注明原文链接:https://www.cnblogs.com/Agtw/p/16845010.html