Pregunta | Respuesta |
stdio.h | Contains input and output functions, types, and macro definitions. This library is used by most C programs and represents almost 1/3 of entire C libraries |
string.h | Contains functions for manipulating strings |
math.h | Contains mathematical functions |
stdlib.h | Contains utility functions for number conversion, storage allocation etc. |
Translating Stage of Compilation | Compiler translates high-level language in .i file to low-level Assembly language instructions. Generated file is .s file |
Assembly Stage of Compilation | Assembler converts assembly language to machine code. Generated object file contains conversion in binary and is .o file |
Linking Stage of Compilation | Linker combines one or more binary object .o files into single executable file. Generated file is in binary and has .exe file |
Variables | A container in C which a data value can be stored inside the computer's memory |
char | Single byte storing 1 character |
int | Stores integer [100] |
float | Stores floating-point to 6 decimal places [0.123456] |
double | Stores floating-point to 10 decimal places [0.0123456789] |
Declaring Variables | Data type and variable name written, followed by ";" [ int car_number; ] |
Initialising Variables | When a value is assigned to a variable [ int car_number = 0; ] |
%d | Specifier for integers -32768 to +32767 [6554] |
%f | Specifier for floating-point [2.1564] |
%c | Specifier for a character [M] |
%s | Specifier for a string of characters [Hello World] |
scanf() | Requires 2 arguments in the brackets specifying type of data inputted and where to store it to |
long int | Usually default of int and has range of values from -2,147,483,647 to +2,147,483,648 |
short int | Saves memory space and has range of values from -32,768 to +32,767 |
Static Variable | Defined outside function, can be used inside using "extern int [variable name];" |
Casting | Process of forcing a variable into a variable of a different data type variable2 = (modifier data-type) variable1; [ float2int = (int)num; ] |
¿Quieres crear tus propias Fichas gratiscon GoConqr? Más información.