How do you know if your code is portable or not? For example will the function rename in stdio.h work on always?
Printable View
How do you know if your code is portable or not? For example will the function rename in stdio.h work on always?
"How do you copy a file?"
"How do you know if your code is portable or not?"
I knew I shouldn't have eaten that expired ham.
Yes, the functions in the standard library will be the same. They are the C++ standard.
So anything from the standard library is portable?
Yes, with two caveats:Quote:
Originally Posted by c_weed
1. Compilers and standard library implementations have bugs.
2. A freestanding implementation (e.g., pertaining to an embedded system) is only required to provide a certain subset of the C++ standard library. Beyond that, what is provided is implementation defined.
O_o
I'm not trying to scare you away from standard functions, but be aware though that not all implementations are created equally.
See `strtok' and `ungetc' functions that vary widely in how well they do what they are supposed to do.
Soma