Как решить эти проблемы
#include<iostream> #include<string> #include<vector> using namespace std; const int CHARBOARDROWS = 7; const int CHARBOARDCOLS = 5; struct Input { string userInput; int x; int y; int choice; int timeStep; int speed; }; Input info; void displayBoard(); Input inputProcess(); void displayA(vector<vector<char>> , int , int); int main() { vector<vector<char>> letterA; letterA.resize(CHARBOARDROWS, vector<char>(CHARBOARDCOLS)); inputProcess(); displayBoard(); displayA(letterA,CHARBOARDROWS,CHARBOARDCOLS); return 0; } void displayBoard() { int numOfRows = 20; int numOfCols = 40; if ((info.y)!>numOfRows || (info.x)!>numOfCols) { displayA(A,CHARBOARDROWS,CHARBOARDCOLS); } for (int row=0;row<numOfRows;row++) { for (int column=0;column<numOfCols;column++) { cout<<'*'; } cout<<"\n"; } } Input inputProcess() { //Input info; cout<<"Please input a string (can up to 25 character long) :\n"; getline(cin,info.userInput); cout<<"\n*********************************************"; cout<<"\nAnchor dot is the top left dot of the string."; cout<<"\n*********************************************"; cout<<"\n\nPlease input coordinate x of anchor dot : \n"; cin>>info.x; cout<<"\nPlease input coordinate y of anchor dot :\n"; cin>>info.y; cout<<"\nPlease choose to display the string :"; cout<<"\n1-scrolling from left to right"; cout<<"\n2-scrolling from right to left"; cout<<"\n3-scrolling upwards"; cout<<"\n4-scrolling downwards"; cout<<"\n5-stationary without scrolling\n\n"<<"INPUT :"; cin>>info.choice; cout<<"\n*********************************************"; cout<<"\nOne time step is one refresh cycle which is\n" <<"made up of a screen clearing process and a\n" <<"display process."; cout<<"\n*********************************************"; cout<<"\n\nPlease input number of time steps :\n"; cin>>info.timeStep; cout<<"\nPlease input speed (between 1 to 10) :\n"; cout<<"1-the slowest\t 10-the fastest\n"; cin>>info.speed; displayBoard(); } void displayA(vector<vector<char>> A, int row, int column) { A[0][2] = '#'; A[1][1] = '#'; A[1][3] = '#'; A[2][0] = '#'; A[2][4] = '#'; A[3][0] = '#'; A[3][4] = '#'; A[4][0] = '#'; A[4][1] = '#'; A[4][2] = '#'; A[4][3] = '#'; A[4][4] = '#'; A[5][0] = '#'; A[5][4] = '#'; A[6][0] = '#'; A[6][4] = '#'; cout<<A[row][column]; } }
Что я уже пробовал:
Ошибки находятся в очереди
if ((info.y)!>numOfRows || (info.x)!>numOfCols)и линия
displayA(A,CHARBOARDROWS,CHARBOARDCOLS);и он показывает, что не может распознать А. Почему это происходит и как исправить эти две ошибки?