I need that code for my program to have colors. But it wont compile if i use -pedantic. Is there a way around this? its btw
gcc -pedantic MP1.c -o hahah MP1.c: In function `main': MP1.c:65: warning: ISO C90 forbids mixed declarations and code MP1.c:686:30: warning: (this will be reported only once per input file)
line 65:
int originalAttrs = ConsoleInfo.wAttributes;
Move declaration of
originalAttrsto the top of the scope in which it is used. The error is unrelated to use ofConsoleInfo.wAttributesbut to the location of the declaration oforiginalAttrs. Without seeing the entire code, it is probably something like:To fix: