New Some File

This commit is contained in:
Hmtsai 2023-11-12 14:27:33 +08:00
parent 3ea952c33b
commit ca60fd748e
4 changed files with 25 additions and 0 deletions

3
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"cmake.configureOnOpen": false
}

View File

@ -0,0 +1,2 @@
#include <iostream>
using namespace std;

View File

@ -0,0 +1,20 @@
#include <cstdio>
#include <iomanip>
#include <iostream>
using namespace std;
struct student {
char name[20];
char sex;
int score;
} studentList[3] = {{"SB1", 'F', 239}, {"SB2", 'F', 232}, {"SB3", 'M', 832}};
int main() {
student *ptr;
cout << setw(9) << "Name "
<< "Sex "
<< "Score " << endl;
for (ptr = studentList; ptr < studentList + 3; ptr++) {
cout << setw(9) << ptr->name << " " << setw(1) << ptr->sex << " "
<< setw(3) << ptr->score << endl;
}
return 0;
}

BIN
src/type/ptr/Advanced/struct Executable file

Binary file not shown.