私は学生の情報とマークを管理するプログラムを作成しています。私の問題は、エラーが発生していることです。入力23,26,29,32、および53行のこの範囲に表示されません。誰かが私が間違っていることを示唆することはできますか?エラー入力がこのスコープに表示されない
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
system("cls");
system("Project Assignment");
system("colr 0f");
cout << "Please enter choice" <<endl;
cout << "1. Input new student" <<endl;
cout << "2. Search for student by number" <<endl;
cout << "3. Edit an exiting student marks" <<endl;
cout << "4. Display all students" <<endl;
cout << "5. Exit" <<endl;
int choice;
cin >> choice;
switch (choice){
case 1:
input();
break;
case 2:
search();
break;
case 3:
edit();
break;
case 4:
displayAll();
break;
}
void input();
{
system("cls");
string fname;
string lname;
string filename;
int mark;
int studNum;
cout << "Input student first Name:" ;
cin >> fname;
cout << "Input student last name: ";
cin >> lname;
cout << "Input student mark: ";
cin >> mark;
cout << "Input student number: ";
cin >> studNum;
string studNum2 = to_string(studNum);
studNum2.append(".txt");
ofstream newstudent(studNum2);
newstudent <<fname <<" " <<lname <<" "<<mark <<" "<<studNum << endl;
newstudent.close();
}
void search();
{
}
void edit();
{
}
void displayall();
{
}
}
私の問題は、入力ケース、検索ケースなどのスイッチケースの選択です。23行目でエラーが発生しました。 – Netherland
@Netherland 2番目と3番目の問題について、でる?あなたは私の修正された疑似コードを見ましたか?それはあなたとどのように違うのでしょうか? –