Thread: Changing printf/cout's color in the command box?

  1. #1
    Unregistered
    Guest

    Changing printf/cout's color in the command box?

    Hi, it's me again.

    I want to know how to change the color of printf's output.

    say I wanted to printf("hello world");
    but instead of the output:
    hello world
    I wanted the output:
    hello world
    How could I go about doing that without changing the graphics mode?

  2. #2
    Unregistered
    Guest

    ...

    Ok, the reason i need this is because I want to fade in a bit of text. i've figured part out, here's an example:

    Code:
    #include <conio.h>
    #include <stdio.h>
    
    int main(void)
    {
    	sleep(100);
    	textcolor(8);
    	printf("hello");
    	sleep(100);
    	textcolor(7);
    	clrscr();
    	printf("hello");
    	sleep(100);
    	textcolor(15);
    	clrscr();
    	printf("hello");
                    return 0;
    }
    but I looks jerky and awful. There aren't enough colors that are shades of grey. Do i need to change the pallette or something? also, how can I get rid of the blinking cursor(urg)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Changing windows without changing?
    By Lionmane in forum Windows Programming
    Replies: 7
    Last Post: 10-19-2005, 11:41 AM
  2. [C++/WinAPI] Changing bitmap contrast
    By jagi in forum Windows Programming
    Replies: 0
    Last Post: 03-27-2005, 03:51 PM