Posts by C. E. Gesser • 3,783 points
54 posts
-
0
votes2
answers998
viewsA: A C compiler can generate a 64-bit executable where pointers are 32-bit?
I don’t know if it helps, but in Visual C++ there is a link flag /LARGEADDRESSAWARE, that allows a 32bit executable to access up to 3 gigabytes of RAM, instead of 2, when it runs on a 64 version of…
-
30
votes1
answer23130
viewsA: How to pass a function as parameter in C?
In C and C++, in addition to normal pointers, it is possible to create pointers for functions. Just as a normal pointer points to a memory region from where you can read or write a value, a pointer…
-
2
votes4
answers556
viewsA: What is the fastest, most memory-saving type?
For integer numbers, the most indicated always the word size number of the processor. It will align right in memory everything else. Since this changes from compiler to compiler, the most guaranteed…
-
3
votes3
answers273
viewsA: How to implement Std::to_string for floating point?
Since you did not specify any constraints for the implementation, the simplest way to do that I would imagine would be: std::string to_string(float f) { std::ostringstream buffer; buffer << f;…