I want to execute linux commands using c++ platform and I am using system() but when i write:
cout<<"Enter the command"<<endl;
cin>>arraystring[size];
system(arraystring.c_str());
it gives error!
a4.cpp: In function ‘int main()’:
a4.cpp:75:20: error: request for member ‘c_str’ in ‘arraystring’, which is of non-class type ‘std::string [100] {aka std::basic_string<char> [100]}’
system(arraystring.c_str());
What should i do to overcome this error?
arraystringdefined?charasstd::string.char*is not a class it's a pointer to a basic data type in c++, consequently it has no member functions such asc_str()