C++动态结构练习

来源:互联网 发布:阿里云服务器支持ipv6 编辑:程序博客网 时间:2024/06/05 09:48

#include <iostream>#include <time.h>#include <string>int caculateYadFromFurlong(int furlong);using namespace std;int main(void){struct student{char name[20];int age;};student *stu = new student;cout << "Please Enter student's name:";cin.get(stu->name,20);cout << "Enter student's age:";cin >> (*stu).age;cout << "student's name is " << stu->name << " age is " << stu->age << endl;cin.get();cin.get();}int caculateYadFromFurlong(int furlong){return furlong*220;}


0 0