I have a problem. I am trying to start a never ending loop. For some reason it will not work. HELP PLEASE!
CODE
#include <iostream>
using namespace std;
int main()
{
system("cmd");
system("color 29");
switch("cmd");
{
case 1 : system("color 01");
break;
case 2 : system("color 02");
break;
case 3 : system("color 03");
break;
case 4 : system("color 04");
break;
case 5 : system("color 05");
break;
case 6 : system("color 06");
break;
}
cin.get();
}
Errors:
C:\Documents and Settings\1337\Desktop\Untitled1.cpp In function `int main()':
9 C:\Documents and Settings\1337\Desktop\Untitled1.cpp switch quantity not an integer
11 C:\Documents and Settings\1337\Desktop\Untitled1.cpp case label `1' not within a switch statement
12 C:\Documents and Settings\1337\Desktop\Untitled1.cpp break statement not within loop or switch
13 C:\Documents and Settings\1337\Desktop\Untitled1.cpp case label `2' not within a switch statement
14 C:\Documents and Settings\1337\Desktop\Untitled1.cpp break statement not within loop or switch
15 C:\Documents and Settings\1337\Desktop\Untitled1.cpp case label `3' not within a switch statement
16 C:\Documents and Settings\1337\Desktop\Untitled1.cpp break statement not within loop or switch
17 C:\Documents and Settings\1337\Desktop\Untitled1.cpp case label `4' not within a switch statement
18 C:\Documents and Settings\1337\Desktop\Untitled1.cpp break statement not within loop or switch
19 C:\Documents and Settings\1337\Desktop\Untitled1.cpp case label `5' not within a switch statement
20 C:\Documents and Settings\1337\Desktop\Untitled1.cpp break statement not within loop or switch
21 C:\Documents and Settings\1337\Desktop\Untitled1.cpp case label `6' not within a switch statement
22 C:\Documents and Settings\1337\Desktop\Untitled1.cpp break statement not within loop or switch
I have a crap load of errors.
The point of the program is to make the command prompt change colors. I have spare time right now if you can't tell.