📄 eg1.cpp
字号:
// eg1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdio.h>
struct PERSON
{
int number;
int age;
double height;
char sex;
};
struct STUDENT
{
int number;
int nScores[10];
};
void fun(PERSON per)
{
printf("%d %c %d %lf\n",
per.number,
per.sex,
per.age,
per.height);
per.age += 1;
}
void fun(int nA[10])
{
nA[2] += 10;
}
int main(int argc, char* argv[])
{
PERSON Persons[10];
STUDENT Students[10];
int nA[10] = {1,2,3,4,5,6,7,8,9,0};
for (int i=0; i<10; i++)
{
Persons[i].number = 1000 + i;
Persons[i].age = 20 + i;
Persons[i].sex = 'M';
Persons[i].height = 177;
}
/*
fun(Persons[2]);
printf("%d %c %d %lf\n",
Persons[2].number,
Persons[2].sex,
Persons[2].age,
Persons[2].height);
*/
printf("%d\n", nA[2]);
fun(nA);
printf("%d\n", nA[2]);
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -