Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
fread/fwrite
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="¬a\\/b, post: 2963226"] portable in my country means: i write a X language program; that program run the same way in all machines in the world that have a X language conform compiler then you can argue how this program is portable in the standard C language #include <stdio.h> #include <stdlib.h> int main(void) {size_t z=0x2FFFF, h=0xFFFFFFFF; z=z*z; printf("Bits(size_t) > 32 ?\n"); if(h<=0xFFFF||z<=h) printf("No\n" ); else printf("Yes\n"); return 0; } because in each machine it could answer in a different way. So what do you mean for the word "portable"? it is a meaningless word in each machine where there are definitions like "size_t=number" or where there are operations with size_t type variable => they are not portable by definition (in each machine could be a different result) the problem is: size_t has different size each machine but let it be size_t has 64 bits for all machine in the world (or it is an memory only dipendent data type like a bignumber) the problem could be for "*" function: can "*" function is the same in all the machine and have the same result for the same operands? the same for all other operators the same for all UB and machine dipendent results the same for all other "fixed all different size" data types [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
fread/fwrite
Top