problem about textcolor, please help!!

This is a discussion on problem about textcolor, please help!! within the C Programming forums, part of the General Programming Boards category; Hi, I am new to changing colors, however i believe there must be some mistake about something I cannot find, ...

  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    66

    Unhappy problem about textcolor, please help!!

    Hi, I am new to changing colors, however i believe there must be some mistake about something I cannot find, this is the program that "Help" shows in order to learn to use the functions, however when i try to run it three mistakes are marked, Compiling NONAME00.CPP:

    Error NONAME00.CPP 13: Call to undefined function 'cprintf' in function main()

    Error NONAME00.CPP 15: Call to undefined function 'textcolor' in function main()

    Error NONAME00.CPP 16: Call to undefined function 'textbackground' in function main()

    please, if someone can help me it could be great, becasŅuse i am really tired of trying, this is the code :

    Code:
    /* textbackground and textcolor example */
    
    #include <conio.h>
    
    int main(void)
    {
    	int i, j;
    
    	clrscr();
    	for (i=0; i<9; i++)
    	{
    		 for (j=0; j<80; j++)
    			 cprintf("C");
    		 cprintf("\r\n");
    		 textcolor(i+1);
    		 textbackground(i);
    	}
    
    	return 0;
    }

    please help!!

    I dont know if there's something wrong about the compiler or what.

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    1) You're compiling as C++ (.cpp).
    2) Your compiler either doesn't have those functions it's complaining about (since they're non-standard functions), or you're not #include-ing the right header. Try reading your compiler's docs / manuals.


    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Registered User
    Join Date
    Aug 2004
    Posts
    66
    in the help part it sais conio.h is the header that has the functions, however it is still not accepting them, is there any other library i can usa, or maybe can i download a new compiler without having to download the full program (I use borland)

  4. #4
    ---
    Join Date
    May 2004
    Posts
    1,379
    this compiles in borland but not gcc
    what compiler are you using?

  5. #5
    Registered User
    Join Date
    Aug 2004
    Posts
    66
    Borland,
    Actually i use borland turbo c++, 4.5

  6. #6
    ... kermit's Avatar
    Join Date
    Jan 2003
    Posts
    1,528
    Quote Originally Posted by sand_man
    this compiles in borland but not gcc
    what compiler are you using?
    gcc has no idea of what conio.h is. If you read the OP's last post, you will see he stated that he is using Borland's compiler, which makes me wonder why in the heck is that thing still around and in use?

    At the OP,

    Get a new compiler!

    !!!

    gcc is a good one, not sure of what is available for windows with it, other than what I have used personally, ie., the one that comes with Cygwin.

    here:

    http://www.cprogramming.com/compilers.html
    Last edited by kermit; 10-18-2004 at 07:30 PM.

  7. #7
    Registered User
    Join Date
    Aug 2004
    Posts
    66
    the problem is that I need to add color to a menu i am creating, but somehow, i believe the compiler i have is wrong or it has bugs (very strange, because version 3.0 runs well)

  8. #8
    ---
    Join Date
    May 2004
    Posts
    1,379
    turbo c++ is OLD
    get a NEW compiler
    http://www.bloodshed.net/devcpp.html

    if you do want to use conio.h header then use
    http://apurvaslair.50g.com/cpp/compilers/borland.html

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help understanding a problem
    By dnguyen1022 in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2009, 05:21 PM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 09:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 03:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 07:54 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21