Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cprintf and printf - how to?

Status
Not open for further replies.

subra

Programmer
Aug 6, 2000
45
0
0
IN
I am using the DOS OS. I am working with Turbo-C only.

i have code like this:

textattr( ); // set to reverse video-black on white
// background
cprintf(" "); prints a reverse video bar

However if i use printf instead of cprintf (everything else
remains the same) then i do not get the reverse video bar.

I am using this to make a foxpro type data entry screen with the reverse video bar being the window to enter data.

can any body tell me what the matter is?

subra if you find this useful let me know at vksubra@icenet.net
 
You're right. If you try to use printf instead of cprintf, then the console will not display it like what you expect. Why? As I know, that's normal because if you change the forecolor or background color and you want to output it and get the effect, then you must use cprintf(). That's because cprintf() is declared in CONIO.H and CONIO.H is all about console right? but printf() is declared in STDIO.H
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top