Address:Http://bbs.chinaunix.net/viewthread.php? Tid = 981231 & extra = & page = 2
I don't know the differences between the two. I don't know how worried it is. I just can't understand it. I can't figure it out. It's a long time, but I still don't
Basic idea:the direct selection sort of n records files can be ordered by N-1 Direct selection order to get an orderly result:① Initial state: Unordered area is R[1..N], ordered area is empty. ② 1th Trip Sortin the unordered area R[1..N], select the
1.Why?Fflush (stdin)Yes
First, check the following program:
# IncludeStdio. h>
Int main (void)
{
Int I;
For (;;){
Fputs ("Please input an integer:", stdout );
Scanf ("% d", & I );
Printf ("% d \ n", I );
}
Return 0;
}
This program will first
Transfer from http://www.ruanyifeng.com/blog/2011/11/eof.htmlWhen learning C language, one of the problems encountered is EOF.It is an abbreviation of end of file that represents the end of the stream. The "text stream" here can be either a file or
One of the problems I encountered when I was learning C was EOF.It is an abbreviation of end of file that represents the end of the stream. The "text stream" here can be either a file or a standard input (stdin).For example, the following code
Original Paste URL: http://www.kuqin.com/language/20111112/314745.htmlIn this collection:One of the problems I encountered when I was learning C was EOF.It is an abbreviation of end of file that represents the end of the stream. The "text stream"
"Summary"
This code is often encountered, while (scanf ("%d", &num)!=eof) {...}, the return value of EOF and the scanf function has not been well researched, this article will be a brief analysis of the problem.
Body"scanf function
EOF
EOF (end of file) is a status returned by the file read operation. It is not a value read from the file, instead, it is a return value when the file reading function reads the end Of the file or cannot read down. The returned value is generally-1
View stdio. h, you can see the following definitions: # define EOF (-1) # DEFINE _ ioeof 0x0010 # define feof (_ stream)-> _ flag & _ ioeof) we can see that the two methods have different principles. Here we will talk about the EOF and feof () macro
First readCode
Code
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> /* Copy input to output:Read one characterWhile (this character is not a file end indicator)Output the characters that
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.