#include <iostream>
#include <string>
#include <math.h>
#include <fstream>
using namespace std;
class Storage
{
public:
Storage();
string information[10][7];
void SetInformation(string,int);
void GetInformation(int);
};
Storage::Storage(){cout<<"\nStorage Activated\n";}
void Storage::SetInformation(string,int i)
{//input
i--;
for (int j=0;j<7;j++)
{
switch(j+1)
{case 1: cout << "\nFirst Name: "; break;
case 2: cout << "\nLast Name: "; break;
case 3: cout << "\nAge: "; break;
case 4: cout << "\nEmail: "; break;
case 5: cout << "\nDoor Number: "; break;
case 6: cout << "\nRoad Name: "; break;
case 7: cout << "\nPost Code: "; break;
default:;}
cin >> information[i][j];}
}
void Storage::GetInformation(int i){
// output
i--;
for (int j=0;j<7;j++)
{
switch(j+1)
{case 1: cout << "\nFirst Name: "; break;
case 2: cout << "\nLast Name: "; break;
case 3: cout << "\nAge: "; break;
case 4: cout << "\nEmail: "; break;
case 5: cout << "\nDoor Number: "; break;
case 6: cout << "\nRoad Name: "; break;
case 7: cout << "\nPost Code: "; break;
default:;}
cout << information[i][j];}
}
int main()
{
int x;
Storage();
Storage Someone;
cin >> x;
Someone.SetInformation(int);
return 0;
}
これは私が今作ったものです。しかし、クラスをアクティブ化する際に問題が発生していますか? つまり、クラスまたはそのメソッドを使用できないということですか? また、正しい方法でクラスを作成しましたか?