Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Miscellaneous newbie C++ questions
#1
I have a few novice questions regarding C++ (the free version of Borland's C++ 5.5 compiler). Firstly, I am having problems changing the colour of text or the background using the CONIO.H header file.
Code:
textcolor(BLUE)
or
textcolor(1)
doesn't seem to do anything, neither does
Code:
textbackground(BLUE)
. I have tried various text modes... C80, C40, and C40X14 etc. I am having no problem with any of the other CONIO commands.

Also, though the question might seem a bit stupid, is there any way to input strings directly with some CIN command? Currently, I am CIN.GET ting an array of characters--the STRING type will not let me input any data with CIN. I am doing this all in a function declared as a STRING and RETURNing the array of characters works, but generates a compiler error. Any suggestions?

Thanks.
In a race between a rock and a pig, don't varnish your clams." -- "Dilbert"
Reply
#2
You can use cin like this:

Code:
cin >> your_string_or_char_array;

It should work.
Reply
#3
I don't try this, but the problem seems to be how you are putting your text in the screen.

If you use printf, the are buffered so you dont get colors you must use cprintf (a function in conio, mostly of the functions in conio that mimic the standard functions begins with c, cgets, cputs).

That should be the problem, is you try c++, i think there's class i can't remember. (conio_in?)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)