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 投票数
文章评分
订阅评论
提醒
guest
0 评论
内联反馈
查看所有评论
京ICP备17066706号-1
0
希望看到您的想法,请您发表评论x