i am try to create a program that prints the numerical value of EOF...
any ideas for the function get the value of EOF using the ASCII table????
plike922
0
Light Poster
Recommended Answers
Jump to PostEOF doesn't have an ASCII value, it's required to be negative:
#include <stdio.h> int main() { printf("%d\n", EOF); return 0; }
Jump to PostAlso pay attention: getchar(), getc(), fgetc() functions return int (not char) values.
In essence, char type in C (but not in C++) is a very short int, that's all.
Jump to PostIn essence, char type in C (but not in C++) is a very short int, that's all.
I think you will find char data type is the same in both c and c++.
All 11 Replies
Radical Edward
301
Posting Pro
ArkM
1,090
Postaholic
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
jephthah
1,888
Posting Maven
ArkM
1,090
Postaholic
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
ohmshiw
0
Newbie Poster
manjunathrs23
0
Newbie Poster
I_m_rude
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
I_m_rude
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.