Qbasicnews.com
November 27, 2021, 04:51:59 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Miscellaneous newbie C++ questions  (Read 2457 times)
aardvark
Senior Member
**
Posts: 228



« on: September 23, 2003, 06:53:30 AM »

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.
Logged

In a race between a rock and a pig, don't varnish your clams."   -- "Dilbert"
Neo
Na_th_an
*****
Posts: 2150



« Reply #1 on: September 23, 2003, 07:14:43 AM »

You can use cin like this:

Code:
cin >> your_string_or_char_array;


It should work.
Logged
xhantt
Member
*
Posts: 90



« Reply #2 on: September 24, 2003, 10:58:42 AM »

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?)
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!