Code -> Build -> Run stdio.lib 01010101010101 void printf(string s) { <output to console> s } file.c #include<stdio.h> int main() { printf(“hello world!”) } Linker Compile file.obj 01010101010101 Compiler o/p Link stdio.h void sprintf (string, string); void printf(string); : File.exe
Data Types, Variables, and Data Output Data Types – type of data (character, integer, decimal etc.) char, short, int, long, float, double, long double, unsigned – char, short, int, long. Variable Has a name Has a fixed memory size allocated to based on its data type It can be assigned a value, interpreted based on its data type Assigning values to variables decimal notation (default) Octal (begin by zero) Hexadecimal (begin by 0x) int a = 10.9 const keyword
A day in Variable’s life Memory Stack of Process { int i; i = 58; int j = 30; int k = i + j; } : 0x239AB78 i 0x292E3FA 58 302829902 : 0x402ACE3 k 0x402ADF6 0x292E3FA 88 0x403ACE3 0x502ACEE : j 0x402ACE3 30 0x502A559 0x639AFC9 :