Re: the mystery of <ctrl-d>
- From: Kevin Handy <kth@xxxxxxx>
- Date: Mon, 30 Apr 2007 15:00:37 -0600
chandanlinster wrote:
/* if the program is executed as shown below:
* $./a.out
* ges<ctrl-d><ctrl-d>
*
* OUTPUT:
* Number of characters = 3
*
* Question: What happens to the first and second <ctrl-d>?
*/
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int j;
for (j = 0; getchar() != EOF;j++)
;
fprintf(stdout, "Number of characters = %d\n", j);
exit(EXIT_SUCCESS);
}
Ok, I admit it! I stole them! I'm really sorry!!
Look, it's been a really really tough month, and I am seriously
behind on my ctrl-D's. My boss is chewing on my a**, and I have
all these TSP reports to do. I didn't think that anyone would
really miss them, so I took them, all right!
----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
.
- References:
- the mystery of <ctrl-d>
- From: chandanlinster
- the mystery of <ctrl-d>
- Prev by Date: Re: break statement in a for loop
- Next by Date: udp help plz
- Previous by thread: Re: the mystery of <ctrl-d>
- Next by thread: String Comparision
- Index(es):
Relevant Pages
|