Ben,
The purpose of the stdint.h file is to allow the programmer ti specify
the size of the variables.
On some systems is an int 32 bits or 64 bits (or even 16 bits on older
systems or 16 bit micros). The size of an int is not specifically
defined in the C standard.
Especially when doing embedded coding the size of a variable (or the
size of the data pointed to by a pointer) is very important.
The stdint.h file is created by the authors of the compiler so that the
programmer can specify the size of the variable that he wants. /int A/
may or may not be 32 bits but /int32_t A/ will always be 32 bits.
This is mostly not a problem on modern 32 bit microprocessors where an
int is 32 bits and a short is 16 bits. However, on that system is a
long 32 bits or 64 bits? By having the typedefs in the stdint.h file,
the programmer can specify the exact size of the variable.
On 8/16/2024 1:38 AM, ben wrote:
On 2024-08-15 7:46 p.m., Mike Katz wrote:
That is the reason for the stdint.h file. Where
you specify the width
of the variable in bits
Looks like a useless file to me.
I never liked any the standards made to C after K&R. Seems more driven
by the latest crappy hardware intel makes, than a language designed by
people who use the product.
C++ or JAVA never made sense because every class is too different
from any other object.Don't say how windows are a good example of object,
they are foobar-ed from the start as they deal in pixels, rather than
a fractional screen display.Text windows worked under DOS.something easy
to program. I don't want write a whole operating system to use modern
software like windows.
Grumpy Ben, trying to find a embedded C compiler for the 68000.
PS: Perhaps if they had good textbook for C and the different
standards I might view modern C with less distrust.