what do i have to do to make this work?!?!?!?
anyways why do I all of sudden get these 2 errors:
../include/conio.c:28: error: `BLACK' was not declared in this scope
../include/conio.c:29: error: `LIGHTGRAY' was not declared in this scope
Printable View
what do i have to do to make this work?!?!?!?
anyways why do I all of sudden get these 2 errors:
../include/conio.c:28: error: `BLACK' was not declared in this scope
../include/conio.c:29: error: `LIGHTGRAY' was not declared in this scope
Stop using conio? or at least use it right also maybe post some code.
what do you mean by "right"?
and do you want all of the code from conio.c?
thats the part thats giving the trouble i thinkCode:static int __BACKGROUND = BLACK;
static int __FOREGROUND = LIGHTGRAY;
If your using dev-C++ which i think you are maybe try this place out it has better implementations of conio.h
http://devpaks.org/list.php?category=Text%20console
omg thanks a ton man
<conio> / <conio.h> is non-standard. (It's not part of the ANSI/ISO C++ language standard.) This means that it's not included with every compiler, and each implimentation of <conio> may be different. That said, it is a psudo-standard and most compilers will have it.
If you want to change color or shading (or include graphics), you will have to use something non-standard. Anything beyond plain text is non-standard. :(
prog-bman is asking you to post your code... not conio.c.Quote:
...maybe post some code.
If simply including <conio> caused the errors, then maybe your compiler is configured incorrectly, or maybe this particular <conio> didn't come with your compiler, and isn't compatible with it???
conio.h is included in dev-cpp. I use it.
And if I am correct int only stores a number. Not letters. char stores letters. so you would want' char var_name = "Black" or something like that.
Actually, no you wouldn't. Internally conio refers to colors by number. BLACK is simply one of several values stored in an enumeration as shown below:Quote:
Originally Posted by Rune Hunter
Edit: Silly me. Forgot to name the enumeration.Code:enum COLORS {
BLACK,
BLUE,
GREEN,
CYAN,
RED,
PURPLE,
YELLOW,
WHITE,
GRAY,
LIGHTBLUE,
LIGHTGREEN,
LIGHTCYAN,
LIGHTRED,
LIGHTPURPLE,
BRIGHTWHITE
};
yea i understand the thing about standard/non standard things. for some reason i didnt have that enum colors in conio.h. after prog-bman showedme how to get conio to work i looked at the new source file and the old one and the old one didnt have that enum thing.