C/C++ Programming Language Flashcards
To master all the concepts pertaining the use of C and C++ in software development.
Makefiles
Yeah
Relational Operator “>”
Greater Than
malloc( ) and calloc( ) functions, what are they and how are they different?
malloc( ) and calloc( ) are library functions that allocate memory dynamically. Accomplished using heap segmenting. Both functions return pointers to the beginning of the memory , or NULL if the allocation failed.
malloc( ) allocates a memory block of a given size (in bytes) and returns a pointer to the beginning of the block. The memory, however, is not initialized. If we try to access the content of the memory block then we’ll get garbage values.
calloc( ) allocates AND initializes memory blocks to zero. Additionally, calloc takes two arguments, the number of blocks to be allocated, and the size of each block.
In either case, any use of these functions must be followed with a call of free( ) in order to deallocate the memory, else you have a memory leak.
The form of the “if” conditional statement
if(condition){statements}
4 phases of code development
1.Code 2.Save 3.Compile 4.Execute
The “Stack” As it pertains to the C language
Stack is a memory region where “local variables”, “return addresses of function calls” and “arguments to functions” are hold while C program is executed. CPU’s current state is saved in stack memory
Relational Operator “<=”
Less than or Equal To
calloc
Yeah?
Relational Operator “!=”
Not Equal To
Relational Operator “>=”
Greater than or equal to
Relational Operator “
Less Than
string
A string is a sequence of characters, more specifically it is an array of characters.
char
Used to specify individual characters (also bytes sometimes as they are only a single byte)
The “Heap” as it pertains to the C language
Heap is a memory region which is used by dynamic memory allocation functions at run time. Linked list is an example which uses heap memory.
int
used to specify integer data types.