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 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:DWORD dwBytesOverwritten; BYTE rgucOverWrite[] = {0xe9,0,0,0,0}; WriteProcessMemory(hTaskManager,(LPVOID)GetProcAddress(GetModuleHandle("ntdll.dll"),"NtQuerySystemInformation"),rgucOverWrite,5,&dwBytesOverwritten);
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.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
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