Check out http://www.progsource.com/c_development.html for a list for each platform.
[ Top | Bottom | Previous section | Next section ]
The MFC/Visual C++ FAQ (mfcfaq.stingray.com/) is maintained by Michael Pickens (formerly maintained by Scot Wingo). Another FAQ is available at www.mvps.org/vcfaq.
[ Top | Bottom | Previous section | Next section ]
Use the following code snipped:
This works with MFC v.1.00 which hopefully means it will work with other versions as well.
[ Top | Bottom | Previous section | Next section ]
You gotta be kidding, right?
Here are a few of the many reasons this is not even remotely feasible:
But the biggest question is not how you can decompile someone's code, but why do you want to do this? If you're trying to reverse-engineer someone else's code, shame on you; go find honest work. If you're trying to recover from losing your own source, the best suggestion I have is to make better backups next time.
[ Top | Bottom | Previous section | Next section ]
In alphabetical order by vendor name:
[If anyone has other suggestions that should go into this list, please let me know; thanks; (cline@parashift.com)].
[ Top | Bottom | Previous section | Next section ]
Recall that when you delete[] an array, the runtime system magically knows how many destructors to run. This FAQ describes a technique used by some C++ compilers to do this (the other common technique is to use an associative array).
If the compiler uses the "over-allocation" technique, the code for p = new Fred[n] looks something like the following. Note that WORDSIZE is an imaginary machine-dependent constant that is at least sizeof(size_t), possibly rounded up for any alignment constraints. On many machines, this constant will have a value of 4 or 8. It is not a real C++ identifier that will be defined for your compiler.
Then the delete[] p statement becomes:
Note that the address passed to operator delete[] is not the same as p.
Compared to the associative array technique, this technique is faster, but more sensitive to the problem of programmers saying delete p rather than delete[] p. For example, if you make a programming error by saying delete p where you should have said delete[] p, the address that is passed to operator delete(void*) is not the address of any valid heap allocation. This will probably corrupt the heap. Bang! You're dead!
[ Top | Bottom | Previous section | Next section ]
Recall that when you delete[] an array, the runtime system magically knows how many destructors to run. This FAQ describes a technique used by some C++ compilers to do this (the other common technique is to over-allocate).
If the compiler uses the associative array technique, the code for p = new Fred[n] looks something like this (where arrayLengthAssociation is the imaginary name of a hidden, global associative array that maps from void* to "size_t"):
Then the delete[] p statement becomes:
Cfront uses this technique (it uses an AVL tree to implement the associative array).
Compared to the over-allocation technique, the associative array technique is slower, but less sensitive to the problem of programmers saying delete p rather than delete[] p. For example, if you make a programming error by saying delete p where you should have said delete[] p, only the first Fred in the array gets destructed, but the heap may survive (unless you've replaced operator delete[] with something that doesn't simply call operator delete, or unless the destructors for the other Fred objects were necessary).
[ Top | Bottom | Previous section | Next section ]
Short answer: Probably not.
In other words, some people would like to see name mangling standards incorporated into the proposed C++ ANSI standards in an attempt to avoiding having to purchase different versions of class libraries for different compiler vendors. However name mangling differences are one of the smallest differences between implementations, even on the same platform.
Here is a partial list of other differences:
[ Top | Bottom | Previous section | Next section ]
libg++ (the library used by g++) was probably compiled with debug info (-g). On some machines, recompiling libg++ without debugging can save lots of disk space (approximately 1 MB; the down-side: you'll be unable to trace into libg++ calls). Merely strip-ping the executable doesn't reclaim as much as recompiling without -g followed by subsequent strip-ping the resultant a.out's.
Use size a.out to see how big the program code and data segments really are, rather than ls -s a.out which includes the symbol table.
[ Top | Bottom | Previous section | Next section ]
There used to be a yacc grammar that was pretty close to C++. As far as I am aware, it has not kept up with the evolving C++ standard. For example, the grammar doesn't handle templates, "exceptions", nor run-time-type-identification, and it deviates from the rest of the language in some subtle ways.
It is available at srawgw.sra.co.jp/.a/pub/cmd/c++grammar2.0.tar.gz
[ Top | Bottom | Previous section | Next section ]
These are not versions of the language, but rather versions of cfront, which was the original C++ translator implemented by AT&T. It has become generally accepted to use these version numbers as if they were versions of the language itself.
Very roughly speaking, these are the major features:
[ Top | Bottom | Previous section | Next section ]
E-mail the author
[ C++ FAQ Lite
| Table of contents
| Subject index
| About the author
| ©
| Download your own copy ]
Revised Jul 10, 2000