标签:
| Level of abstraction | Languages |
| Directly manipulate memory | Assembly(x86,MIPS) |
| Access to memory | C,C++ |
| Memory managed | Java,C#,Scheme/Lisp,ML |

| Stack | Heap | |
| Memory is allocated Memory is deallocated Addresses are assigned | Upon entering function Upon function return Statically | With malloc With free Dynamically |
int *p = malloc(sizeof(int));free(p);#ifndef _HEADER_NAME
#define _HEADER_NAME
/* Header code here. */
#endif| Enforcements and warnings | |
| -ansi -pedantic -Wall -W | Tells compiler to enforce ANSI C standards. More pedantic ANSI with warnings. Shows all warnings. Show some warnings(return without a value, etc.). |
| Compilation/output | |
| -c -S -E -o [file] | Compile and assemble,but do not link. Stop after compilation; do not assemble. Stop after preprocessing; do not compile. Put the output binary in [file]. |
| Profiling | |
| -pg | Compile with profiling information |
Introduction to C Memory Management and C++ Object-Oriented Programming
标签:
原文地址:http://www.cnblogs.com/codetravel/p/4534578.html