|
|
| Current Rating |
5.09523809523809 |
| Rate Resource |
|
|
| Number of Reviews |
5 |
|
Review this Resource
|
| Reviews: |
- just add the line "system ("PAUSE");" right before the return of main.
#include "global.h" //header files, function prototypes, & classes
void setcolor(unsigned short color) { //begining of set color funtion
HANDLE hCon = GetStdHandle(STD_OUTPUT_HANDLE); //gets std handle
SetConsoleTextAttribute(hCon,color); //Sets Console Text Attribute HCon color.
} //end of set color funtion
int main() { //begining of main funtion
printf("What color do you want the text to be?(1 = blue, 2 = green, 4 = red, 14 = yellow)"); //displays text
scanf("%d", &C.I); //scans number
setcolor(C.I); //sets color
cout << " _____ ____ ____ _____\n"; //displays text
cout << "|_ _|| __ || ___||_ _|\n"; //displays text
cout << " | | | __||__ | |\n"; //displays text
cout << " | | | |__ __| | | |\n"; //displays text
cout << " |_| |____||____| |_|\n"; //displays text
system ("PAUSE");
return 0; //returns 0
} //end of main function
posted at 09:11 p.m. on 12-20-2004
- lol people. Here's the thing, when programs are done running their tasks, they terminate, everything goes so fast you don't see anything, you just have to give it an infinate loop at the end before return. for(;;), while(1);, while(true);
Either of those
posted at 07:53 p.m. on 08-26-2004
- I had to work a little to get the source to compile with Dev-C++ 4.9.8.7, but finally got it to work with warnings...i added the line "#include <iostream>" for cout, then before the functions "using namespace std;" for cout, and also to fix the problem of the program ending early, add the line "getchar();" TWO times before the return statement. sloppy code...
posted at 08:13 p.m. on 04-05-2004
- yeah... I dont understand it,,, "choose color 1=blue" you press 1, and the progg ends...wierd..
posted at 11:13 a.m. on 03-13-2004
- seems tow ork fine. when you run the .exe it ends before you have a real chance of seeing the colour but it is there.....
posted at 07:42 p.m. on 11-30-2003
|
|