Community Sites
Create your own community website and start earning today !
It's Free !
 
Communities Members BookmarksPolls Fresher Jobs Funny Pictures MCA Projects New Member FAQ  



My Profile
Active Members
TodayLast 7 Days more...



Awards & Gifts
Online Exams

Fresher Jobs


Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi

Resources


Find educational articles, blogs, discussion threads and other resources.

Colleges


Find details about any college in India or search for courses.

website counter



C QUESTIONS ON STDIO HEADER FILE(SECTION-8)


Posted Date: 27 Apr 2008    Resource Type: Articles/Knowledge Sharing    Category: Jobs & Interviews

Posted By: umang garg       Member Level: Gold
Rating:     Points: 5



78. Why does errno contain ENOTTY after a call to printf?

A: Many implementations of the stdio package adjust their behavior slightly if stdout is a terminal. To make the determination, these implementations perform an operation which fails (with ENOTTY) if stdout is not a terminal. Although the output operation goes on to complete successfully, errno still contains ENOTTY.

Reference: CT&P Sec. 5.4 p. 73.

79. My program's prompts and intermediate output don't always show up on the screen, especially when I pipe the output through another program.

A: It is best to use an explicit fflush(stdout) whenever output should definitely be visible. Several mechanisms attempt to perform the fflush for you, at the "right time," but they tend to apply only
when stdout is a terminal. (See question 78.)

80. When I read from the keyboard with scanf(), it seems to hang until I type one extra line of input.

A: scanf() was designed for free-format input, which is seldom what you want when reading from the keyboard. In particular, "\n" in a format string means, not to expect a newline, but to read and
discard characters as long as each is a whitespace character.

It is usually better to fgets() to read a whole line, and then use sscanf() or other string functions to parse the line buffer.

81. How can I recover the file name given an open file descriptor?

A: This problem is, in general, insoluble. Under Unix, for instance, a scan of the entire disk, (perhaps requiring special permissions) would theoretically be required, and would fail if the file
descriptor was a pipe or referred to a deleted file (and could give a misleading answer for a file with multiple links). It is best to remember the names of open files yourself (perhaps with a wrapper function around fopen).




Responses

Author: umang garg    27 Apr 2008Member Level: Gold   Points : 2
THESE ARE VERY GOOD QUESTION OF C LANGUAGE ON A TOPIC HEADER FILE(STDIO).THESE ARE QUESTION AND ANSWER WHICH WAS DEVELOPED BY SPECIALLIST OF C LANGUAGE AND IT MY ASSURANCE TO YOU THAT IF YOU GO THROUGH THESE QUESTION THEN YOU REALLY MAKE A ANSWER TO YOU RECRUITER ON TOPIC OF HEADER FILE ON STDIO.



Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Requirement for Programme Manager
Previous Resource: C QUESTION ON DECLARATION(SECTION-9)
Return to Discussion Resource Index
Post New Resource
Category: Jobs & Interviews


Post resources and earn money!
 
Related Resources



Watch TV Channels
  • Watch Asianet TV online
  • Kairali TV in Internet
  • Surya TV online
  • Amritha TV Channel

  • Contact Us    Privacy Policy    Terms Of Use   

    SpiderWorks Technologies Pvt Ltd. 2006 - 2007 All Rights Reserved.