using namespace std;
// system prototype
void doYouHaveProblem();
void timePass();
// defining global variables
char ch;
char repeat = 'Y';
int main ()
{
timePass();
doYouHaveProblem();
return 0;
}
void timePass ()
{
cout << "Have you watched the movie lion king before? (ENTER Y/N)" << endl;
cin >> ch;
if (toupper(ch) == 'Y')
{
cout << "So you know what Hakuna Matata means!" << endl;
system("pause");
}
else
{
cout << "Hakuna Matata -- It means No Worries for the Rest of your Days!!!" << endl;
system("pause");
}
}
void doYouHaveProblem ()
{
do
{
system("cls");
cout << "Do you have a problem in your life? (ENTER Y/N)" << endl;
cin >> ch;
system("cls");
if (toupper(ch) == 'Y')
{
cout << "Can you do something about it? (ENTER Y/N)" << endl;
cin >> ch;
system("cls");
if (toupper(ch) == 'Y')
cout << "Then do it and don't worry about it -- \"HAKUNA MATATA\"" << endl;
else
cout << "Then dont worry about it -- \"HAKUNA MATATA\" " << endl;
}
else
cout << "Then dont worry about it -- \"HAKUNA MATATA\" "<< endl;
system("pause");
system("cls");
This is my code, how do i create an exe file out of this?
also what does system("cls") do exactly? because in the timePass function if i put system("cls") after the IF but before the ELSE. And if the "if" statement gets executed, the else also gets executed after that automaticly.... Weird right?
I have the visual studio 2010 student edition, how do i create exe file out of my cpp?
I saw one of my friend's sad status on facebook and decided to make a small program for him, thought it would bring a small smile on his face, i want to send it to him.
In the start menu, is there a command line compiler? On my computer, with VC Express, there is a program called "Visual Studio Command Prompt (2010)". Use that as a compiler, use the 'cd' command to navigate to the source file and use 'cl *.cpp" to compile the code.
Any C++ compiler create object file (.obj or .o) and executable file(.exe) file under windows at your .cpp files directory.Check file named yourprogramname.exe at build folder.