Thread: I can't use ANSI escape sequences and ncurses! HELP!

  1. #1
    Registered User
    Join Date
    Mar 2012
    Posts
    9

    I can't use ANSI escape sequences and ncurses! HELP!

    I'm trying to display a colored text but when I use the ANSI escape sequences, I get this error: unrecognized character escape sequence.
    I'm using Visual C++ 6.0. Is this kind of error normal or did I install the IDE wrong? Also, I couldn't understand how ncurses are used. I tried to run a sample code using ncurses, but I still get an error: cannot open include file: 'ncurses.h', no such file or directory.

    Can anyone give me a simple sample code in displaying a colored text? I would really really appreciate it.

  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
    ncurses (or pdcurses for win32) need you to download and install a library.

    If you just care about win32 for the moment (which you seem to, given your compiler), then read this
    Win32 Console Applications 4
    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
    Mar 2012
    Posts
    9
    I'm supposed to program in C.

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    The C++ elements of the examples in that article can be replaced by C equivalents without changing their essence.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #5
    Registered User
    Join Date
    Mar 2012
    Posts
    9
    Oh, I see. Ok, I'll try it now.

  6. #6
    Registered User
    Join Date
    Mar 2012
    Posts
    9
    Oh, thank you so much! I got it now!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Escape sequences in c
    By linuxlover in forum C Programming
    Replies: 3
    Last Post: 11-03-2010, 02:39 PM
  2. C Escape sequences
    By Tool in forum C Programming
    Replies: 10
    Last Post: 11-20-2009, 09:38 PM
  3. ANSI Escape Sequences OR Scan of keyboard
    By Samppa in forum Linux Programming
    Replies: 3
    Last Post: 10-24-2001, 12:15 PM
  4. Escape sequences in VC++
    By emilyh in forum Windows Programming
    Replies: 7
    Last Post: 09-26-2001, 07:02 AM
  5. Escape Sequences
    By Me-Again-Again in forum C Programming
    Replies: 3
    Last Post: 09-05-2001, 06:24 AM