-
Colorful printf...
So I have this function "void textcolor(int color)" where "color" can be replaced with the basic 16 colors upon input.
Code:
void highvideo();
void textcolor(int color);
I don't understand how to impliment this with "printf" though. Is there a text string output function that allows &color INSIDE of the string? Example:
Code:
// Where &R is the color red and &B is blue
printf("This &Rwould &Bbe &Rcolorful...");
Any ideas on how I can impliment this into a string output function?
-
use cprintf() to print with colours, I think that the syntax is the same as in printf().
Code:
#include <stdio.h>
#include <conio.h>
int main()
{
textcolor(BLUE);
textbackground(RED);
cprintf("Hello world!");
getch();
}
-
Would you be willing to post iostream.h for me?
I'm using LCC-WIN32 ver. 3.3 but it seems mine is bad.
I get a redefinition error for "_op_piostream_int" when I try to include the header in my code. I didn't redefine it in my code either, it simply comes up as being defined twice in the header.
So if you know you have a working version for my compiler, I'd appreciate you post it here.
-
You don't need iostream.h for cprintf(), just stdio.h
And even if I send you iostream.h you only have the header, not the libraries.
-
I need iostream.h for CIN and COUT (not so much COUT as CIN though.)
However, if you tell me a different function that does the similar as CIN, then that'd be cool as well.
I wanted the header file because that's where the error is coming from. The library files may not be the problem.
Now I ask kindly: Please post iostream.h, if you don't want to, then you have no obligation to post an excuse on this thread. Thank you.
-
1 Attachment(s)
If you want the C-equivalent to cin, use scanf();
printf() and scanf() is C
cout & cin is C++
Anyway, here's the file: