By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,749 Members | 2,036 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,749 IT Pros & Developers. It's quick & easy.

how to print the value of EOF?

P: n/a
i am trying to print the value of EOF, which is an integer defined in
<stdio.h>, as told by K&R2.
----------------------- PROGRAMME ---------------------
#include <stdio.h>

int main() {

printf("%D\n", EOF);

return 0;
---------------------- OUTPUT ---------------------------------
[arch@voodo kr2]$ gcc -ansi -pedantic -Wall -Wextra ex-151-1.c
ex-151-1.c: In function 'main':
ex-151-1.c:5: warning: unknown conversion type character 'D' in format
ex-151-1.c:5: warning: too many arguments for format
[arch@voodo kr2]$

Mar 8 '07 #1
Share this Question
Share on Google+
1 Reply

P: n/a
On Mar 8, 11:22 am, "arnuld" <geek.arn...@gmail.comwrote:

----------------------- PROGRAMME ---------------------
#include <stdio.h>

int main() {

printf("%D\n", EOF);
printf("%d\n", EOF");

SORRY, my mistake.

Mar 8 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.