Thread: Changing font style and color of text in C

  1. #1
    Registered User
    Join Date
    Jul 2006
    Posts
    4

    Changing font style and color of text in C

    The text color and font is the same throughout the whole exe file. How can I call library and change them?
    I want to set the given numbers to red in a sudoku.

    P.S. Are there any online sudoku source codes in C?
    Thank you.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > How can I call library and change them?
    Well that would depend on your OS / Compiler and project type (none of which you state).
    In the meantime, try the FAQ
    http://faq.cprogramming.com/cgi-bin/...&id=1043284392

    > Are there any online sudoku source codes in C?
    Have you tried google?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Jul 2006
    Posts
    4
    Does this code change color of all the text? Can I change color of certain words only?
    Thank you

  4. #4
    Registered User
    Join Date
    Jul 2006
    Posts
    4
    When I compile the following code, an error occurs.
    I use Dev-C++. Does this software have the library conio.h?
    Thank you.


    #include <stdio.h>
    #include <conio.h>

    int main ( void )
    {
    textcolor ( MAGENTA );
    cprintf ( "This is a test\n" );

    return 0;
    }

  5. #5
    Registered User
    Join Date
    Jul 2006
    Posts
    4
    Thanks MDofRockyView, I have done this but an error occurs. My Dev-c++ doesn't say what error it is...

  6. #6
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > I use Dev-C++. Does this software have the library conio.h?
    Scroll down the FAQ to where it describes the Win32 console API functions.

    conio is a hack for backward compatibility with DOS.

    Oh, and be more specific than "an error occurs".
    Paste error messages.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed