标签:
1 #include<stdio.h> 2 class Student 3 { 4 public: 5 char *names; 6 int age; 7 float weight; 8 public:void say() 9 { 10 printf_s("%s的年龄是%d体重是%f", names, age, weight); 11 } 12 }; 13 int main() 14 { 15 Student stu; 16 stu.names = "xiaoming"; 17 stu.age = 17; 18 stu.weight = 60.3; 19 stu.say(); 20 getchar(); 21 return 0; 22 }
标签:
原文地址:http://www.cnblogs.com/releed/p/5470105.html