How to maintain fixed size of C variable types over different machines?

Posted by Alex on Stack Overflow See other posts from Stack Overflow or by Alex
Published on 2010-03-24T20:43:33Z Indexed on 2010/03/24 20:53 UTC
Read the original article Hit count: 205

Filed under:
|

I've all this kind of functions.

ssize_t fuc1(int var1, void *buf, size_t count);
int func2(char *charPtr, int mode, int dev);
short func3( long var2);

problem is that data types in C has different sizes when compiled on different machines(64bit & 32bit). This is true for even void*. For some reasons. I need to ensure that these sizes all are same on every machine(64bit & 32bit). So, how should I modify these ?

© Stack Overflow or respective owner

Related posts about c++

Related posts about c