I was just wondering if there was another way to out put text besides cout? I know this probablt sounds weird because cout works perfectly fine and stuff, but I just want to know if all of the input/output has to be done in a cprompt window? Dose anyone know of an alternative. All help is appreciated!! ^_^
#include<DAN.h>
-4
Light Poster
Recommended Answers
Jump to PostThat depends on the libraries you're using. The standard library also lets you output to files and to the stderr output stream.
Other libraries exist that let you make windows in the windowing system and send text over a network.
What you can use depends on what you …
Jump to Postprintf is your best bet for a cout alternative. It is from the cstdlib library (for C++, stdlib.h for C)
Jump to Postprintf() and cout both send data to the same place.
C++ only knows of the standard input, output, and error channels, and any other files/sockets/devices/etc. you explicitly open.
If you want to display things differently on Windows, you have to go through the Win32 API. For example:
Jump to Post>I was just wondering if there was another way to out put text besides cout?
You can use cerr, it's normally pointed to the same location as cout. You can also use the standard C output functions, but that can open an unexpected can of worms when it comes to …
All 14 Replies
sarehu
84
Posting Whiz in Training
#include<DAN.h>
-4
Light Poster
ShawnCplus
456
Code Monkey
Team Colleague
Duoas
1,025
Postaholic
Featured Poster
Narue
5,707
Bad Cop
Team Colleague
Brent.tc
0
Junior Poster in Training
Narue
5,707
Bad Cop
Team Colleague
bector
-3
Newbie Poster
jeevsmyd
-2
Junior Poster
jeevsmyd
-2
Junior Poster
grumpier
149
Posting Whiz in Training
jeevsmyd
-2
Junior Poster
grumpier
149
Posting Whiz in Training
Duoas
1,025
Postaholic
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.