Solved

Conversion

Posted on 1999-01-25
2
223 Views
Last Modified: 2010-04-15
How do I trap the value of EOF?

main()
{
int c;
c=getchar();
while(c != EOF)
putchar(c);
c=getchar();
}
}
0
Comment
Question by:JMarshall
2 Comments
 

Author Comment

by:JMarshall
ID: 1258359
Please rewrite code to print the Value of EOF!
0
 
LVL 16

Accepted Solution

by:
imladris earned 40 total points
ID: 1258360
How about:

main()
{
int c;

do
{   c=getchar();
    putchar(c);
} while(c != EOF)
}
}

P.S. You could also find what the value is by inspecting stdio.h.

0

Featured Post

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now