C++动态结构练习

“`c++
#include <iostream>
#include <time.h>
#include <string>

int caculateYadFromFurlong(int furlong);

using namespace std;

int main(void)
{
struct student
{
char name[20];
int age;
};

<pre class="prism-highlight line-numbers" data-start="1"><code class="language-null">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();
</code></pre>

}

int caculateYadFromFurlong(int furlong)
{
return furlong*220;
}
“`

0 0 vote
Article Rating
Subscribe
提醒
guest
0 评论
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x