So i'm working on this program. And long story short, I need something that will allow the user to choose the dir/file and have the system set read-only to true.
Here is a piece that I worked on. Only it crashes on the system line.
try
{
clear;
char* dir;
cout << "Enter folder location > ";
cin >> dir;
char l_szCommand[50];
sprintf(l_szCommand, "attrib +r %s", dir);
system(l_szCommand);
Sleep(5000);
}
catch (int e)
{
clear;
cout << "Error: " << e << endl;
system("PAUSE");
}
Forgive me for anything wrong with this for I am just about a few hours new to C++. And i'm only 13...