Thursday, October 11, 2012

Best way to master C/C++

Use the "-S" option when you compile the code like "bcc32.exe -S Hello.c". This option informs the compiler to generate the assembly code of the given C code which is linked to produce the executable. Now open the asm code and understand how C works at the most minute level.
This helps a lot in understanding the stack and how datatypes are dealt with. "-S" option works with almost every compiler, if it doesnt work, check the compiler manual for generating asm code.