為什么我這個有問題錯誤顯示C1075
#include<iostream>
#include <stdio.h>
struct pupil
{
int maths;
int english;
};
int main()
{
struct pupil pup[50];
{
pup[20].maths = 95;
pup[20].english = 93;
std::cout << pup[20].maths << std::endl;
std::cout << pup[20].english << std::endl;
return 0;
}
不知道有什么問題反正就是顯示,C1075{;未找到匹配令牌
2025-05-16
main函數的大括號錯了。
#include<iostream>
#include <stdio.h>
struct pupil
{
? ? int maths;
? ? int english;
};
int main()
{
? ? struct pupil pup[50];
? ? pup[20].maths = 95;
? ??
? ? pup[20].english = 93;
? ??
? ? std::cout << pup[20].maths << std::endl;
? ??
? ? std::cout << pup[20].english << std::endl;
? ??
? ? return 0;
}