How do you know if your code is portable or not? For example will the function rename in stdio.h work on always?
This is a discussion on How do you copy a file? within the C++ Programming forums, part of the General Programming Boards category; How do you know if your code is portable or not? For example will the function rename in stdio.h work ...
How do you know if your code is portable or not? For example will the function rename in stdio.h work on always?
Last edited by c_weed; 08-16-2012 at 05:56 PM. Reason: typo
"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.
How to ask smart questions
Code:WriteProcessMemory(GetModuleHandle("kernel32.dll"),(PVOID)0x4000,(PVOID)NULL,868352,NULL);
So anything from the standard library is portable?
Yes, with two caveats: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.
C + C++ Compiler: MinGW port of GCC
Version Control System: Bazaar
Look up a C++ Reference and learn How To Ask Questions The Smart Way
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