C has inspired various other languages. Languages that are extensions of C include C++ and Objective-C.
Major interpreters and virtual machines written in C:
Major operating systems written in C:
Major systems writtin in C:
You really should know C. I recommend learning C before C++ or Objective-C.
Memory management is what makes C (and C++) a significantly different beast. Precautions must be taken, even by programmers transitioning from C++.
&
is “address of” – use on variable to get its memory address*
is “dereference” – use on pointer variable to get/set value->
is “access member” – use with struct/union to access member variable. Recall that it is sugar for dotting into dereferenced variableUse malloc
to dynamically allocate memory on the heap:
int* integers = (int*) malloc(sizeof(int) * 10);
sizeof
data type by number of that data
sizeof(int) * 10
for an integer array of 10void*
(void pointer) which you should castfree
functionNULL
after freeing memoryC dynamic memory allocation. Wikipedia.
Dangling pointer Wikipedia.
malloc. Linux man page. Covers malloc
, free
, calloc
, realloc
.