c-resources/CPlusPlus20ForProgrammers-m.../examples/ch06/fig06_01.cpp

41 lines
400 B
C++

//variable scope
#include<iostream>
//global variable
//local variable
int k=0;
//function
//array
//struct
//class
//Macro
int main()
{ //block
cout<<k;
int k = 2;
int j=0;
{
int i=0;
}
cout<<k;
cout<<::k;
}
//definition
short 2B
unsigned int 4B
signed long 8B
1B = 0xFF
float
double
unsigned char
string
bool
int i=10;
//initialization
long b;
b=1200;
//assignement