gahhon
13
Junior Poster
Recommended Answers
Jump to PostIf you mean the number of bytes of an int, then the sizeof operator is what you want.
int size_of_int = sizeof(int);
Jump to PostDo you mean how large of a value? If you do then check the limits.h library
Jump to PostThe reason your while loop keeps going, is because 'sizeof(int)' generates a constant value. An int does not expand when you increase its value, so no matter if you
Since you just want to check wether the year is two digits, you can use:
while (Student[i].regNo.year …
All 12 Replies
GuitarComet
0
Light Poster
gahhon
13
Junior Poster
gerard4143
371
Nearly a Posting Maven
gahhon
13
Junior Poster
GuitarComet
0
Light Poster
gerard4143
371
Nearly a Posting Maven
GuitarComet
0
Light Poster
gahhon
13
Junior Poster
gerard4143
371
Nearly a Posting Maven
WaltP
commented:
That input is really lame. Why use the bloated fscanf instead of the simple fgetc?
-3
gahhon
13
Junior Poster
gerard4143
371
Nearly a Posting Maven
gahhon
13
Junior Poster
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.