including C header "stdint.h" in C++

E

E. Robert Tisdale

J. Campbell said:
I'm wondering if there are any compelling reasons
NOT to use the types defined in <stdint.h> in C 99 programs?

These definitions have not been included in the ANSI/ISO C++ standards
[yet] -- there is no standard <cstdint> header file yet.

Try defining your own:

#ifndef GUARD_CSTDINT
#define GUARD_CSTDINT 1
#include <stdint.h>
#endif//GUARD_CSTDINT
 
J

Jeff Schwab

Alf said:
It will be (at least, all indications are that it will be).

When it is, I'll use it.
Nope. No fixed sized or minimum size types in numeric_limits.

You're right, but it's not hard to use numeric_limits to find out what
sizes are available, and typedef them accordingly. This is what I do
for code that must run on both 32- and 64-bit systems.

Well, perhaps I'll give stdint a look.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top