please help to with this program by mainly using arrays and pointers ,... i need this program to check 2 matrix files "if they contain any character and if they contain cout<<"invalid"; " and to open them from .txt file
#include<iostream>
#include<fstream>
#include<string>
#include<cmath>
using namespace std;
int main()
{
char y, n;
ifstream file1;
ifstream file2;
string filename1;
string filename2;
string c;
int number;
int choice;
cout<<"xxxxxxx matrix calculator \n";
cout<<"please choose from the following menu :\n";
while(choice!=8&&choice==n)
{
cout<<"1. matrix addition\n";
cout<<"2. matrix subtraction\n";
cout<<"3. matrix multiplication\n";
cout<<"4. matrix transpose\n";
cout<<"5. checking matrix equality\n";
cout<<"6. check matrix properties\n";
cout<<"7. matrix power\n";
cout<<"8. exit\n";
cout<<"please enter your choice\n";
cin>>choice;
while(//condition when there is character)// for the first file and the second one :D
{
cout<<"invalid file!!\n";
cout<<"do you want to continue (y) or return to menu(n)\n";
/* "y" to continue to try to enter the file name again & "n" to go back to the menu*/
cin>>choice1;
if(choice1=='y')
{
cout<<"please enter the first filename\n";
cin>>filename1;
file1.open(filename1.c_str(),ios::in);
if(!file1.fail())
{
cout<<"good\n";
break;
}
}
else if(choice1=='n')
{
cout<<"assdasdasdad\n";
break;
}
}
switch(choice)
{
case 1 :
case 2 :
case 3 :
case 4 :
case 5 :
case 6 :
case 7 :
case 8 :
cout<<"thank you for using my program\n";
exit(1);
}
system ("pause");
return 0;
}
}