C - Compiler
C identifiers represent the name in the C program, for example, variables, functions, arrays, structures, unions, labels, etc.
| auto | double | int | struct |
| break | else | long | switch |
| case | enum | register | typedef |
| char | extern | return | union |
| continue | for | signed | void |
| do | if | static | while |
| default | goto | sizeof | volatile |
| const | float | short | unsigned |
A variable is a quantity that may change within the context of a mathematical problem or experiment. Typically, we use a single letter to represent a variable. The letters x, y, and z are common generic symbols used for variables.
int (unsigned , unsigned short ,long )
char
float
double
Void data type
| Format Specifier | Type |
|---|---|
| %c | Character |
| %d | Signed integer |
| %e or %E | Scientific notation of floats |
| %f | Float values |
| %g or %G | Similar as %e or %E |
| %hi | Signed integer (short) |
| %hu | Unsigned Integer (short) |
| %i | Unsigned integer |
| %l or %ld or %li | Long |
| %lf | Double |
| %Lf | Long double |
| %lu | Unsigned int or unsigned long |
| %lli or %lld | Long long |
| %llu | Unsigned long long |
| %o | Octal representation |
| %p | Pointer |
| %s | String |
| %u | Unsigned int |
| %x or %X | Hexadecimal representation |
| %n | Prints nothing |
| %% | Prints % character |
To control electronic devices do we need to talk in electronic ?
Binary number
system
0 AND 1
section .text
global _start ;must be declared for linker (ld)
_start: ;tells linker entry point
mov edx,len ;message length
mov ecx,msg ;message to write
mov ebx,1 ;file descriptor (stdout)
mov eax,4 ;system call number (sys_write)
int 0x80 ;call kernel
mov eax,1 ;system call number (sys_exit)
int 0x80 ;call kernel
section .data
msg db 'Hello, world!', 0xa ;string to be printed
len equ $ - msg ;length of the string#include <stdio.h>
int main() {
// printf() displays the string inside quotation
printf("Hello, World!");
return 0;
}