【发布时间】:2018-04-05 08:06:59
【问题描述】:
void student_info(char *name, int *hw1, int *hw2, int *hw3, int *ex1, int *ex2)
{
printf("Please enter the student's name:\n");
gets_s(name, 20);
printf("\nPlease enter the student's homework grades:\n");
scanf("%d %d %d", & (*hw1), & (*hw2), & (*hw3) );
printf("\nPlease enter the student's exam scores:\n");
scanf("%d %d", & (*ex1) , & (*ex2) );
}
【问题讨论】:
-
你确定那是c#吗?
-
这看起来不像 C#...
-
它看起来像 C 或 C++,而不是 C#
-
绝对是 C 或 C++,崩溃的原因可能是错误使用导致(很可能)堆栈覆盖的函数。尝试搜索
scanf函数的使用方法。 -
写好问题的技巧; 1)“崩溃”告诉我们什么;如何? 究竟会发生什么? 2)你做了什么来调试它?你走过了吗?它到底发生在哪里? 3) 使用正确的标签;虽然 可以在 C# 中编译,但您实际上在此处使用 C# 不太可能
标签: c#