Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 9th, 2007, 2:08 PM   #11
jim mcnamara
Hobbyist Programmer
 
Join Date: Jun 2005
Location: New Mexico
Posts: 228
Rep Power: 4 jim mcnamara is on a distinguished road
Canonical vs non-cononical terminal I/O?

The setbuf function in stdio is defined to be able to turn off/on buffering. Subsequent fprintf calls are affected. In most implementations, you must call setbuf before any I/O to the terminal occurs.

Windows and unix have terminal I/O libraries that change terminal characteristics as well.
jim mcnamara is offline   Reply With Quote
Old May 16th, 2007, 2:35 AM   #12
Fall Back Son
Hobbyist Programmer
 
Join Date: Oct 2006
Posts: 204
Rep Power: 2 Fall Back Son is on a distinguished road
edit: sorry, I had read all of the posts in here except a couple newer ones and I didn't realize the guy above me already mentioned setbuf.

my advice is to go to linux and type in man stdout.. it gives a lot of useful information, including (some) of what has been said here. If you want to, you can change the buffering mode (for lack of a better term) using setbuf. I haven't played with it, so I'm not sure how advisable it is to do so. Maybe one of these guys wouldn't mind giving some advice on how to use it properly.

Fall Back Son is offline   Reply With Quote
Old May 27th, 2007, 3:02 PM   #13
Harakim
Hobbyist Programmer
 
Join Date: May 2006
Location: West Jordan, Utah, United States
Posts: 176
Rep Power: 3 Harakim is on a distinguished road
Quote:
Originally Posted by cwl157 View Post
i figured it out. sprintf is used to fill the string and then write is used to write the string and then you pass either STDOUT_FILENO for the screen cause its standard out or STDERR_FILENO for standard error
Use the write() function if you are in a posix environment. I have never done low-level c in windows, but every other environment I have worked in has it.

write( STDOUT_FILENO, message, strlen(message) );

I suppose this is too late to help with your assignment, but not to late to learn something.


search for:
"c write function"
(without quotes) in google if you would like to know more.
Harakim is offline   Reply With Quote
Old May 27th, 2007, 5:43 PM   #14
rsnd
Hobbyist Programmer
 
rsnd's Avatar
 
Join Date: Jun 2005
Location: Helltown
Posts: 162
Rep Power: 4 rsnd is on a distinguished road
for windows you can get output handle by GetStdHandle(STD_OUTPUT_HANDLE); (kernel32.lib) You can use native windows file write functions to write to it.
__________________
Spread your wings and fly! Chicken!
rsnd is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Slackware installation guide for Linux beginners coldDeath Coder's Corner Lounge 104 Jul 29th, 2007 4:40 AM
Clear screen with Java Eric the Red Java 9 Feb 22nd, 2006 10:28 PM
Senior Capstone-Spying Screen Saver Hounder Project Ideas 23 Dec 16th, 2005 7:00 PM
Print Screen? Sane C++ 5 Jul 27th, 2005 1:44 AM
Conversions Sane Python 12 Apr 28th, 2005 6:25 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:04 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC