C言語 構造体と関数
Posted: 2016年7月05日(火) 22:30
構造体と関数を使ってItohさんの点数を表示したいのですが、なにがおかしいのでしょうか
#include <stdio.h>
struct scores{
char name[100];
int math;
int physics;
int eng;
};
void printscore(struct scores st)
{
printf("%s さんの点数\n",st.name);
printf(" 数学: %d 点\n",st.math);
printf(" 物理: %d 点\n",st.physics);
printf(" 英語: %d 点\n",st.eng);
int main(void)
{
struct scores st={"Itoh",85,79,90};
printscore(st);
return 0;
}