Typedef and Preprocessor directives
typedef
#include <iostream>
#include <vector>

typedef std::vector<int> intContainer;

int main(int argc, char *argv[])
{
	intContainer c;
	for(int i = 0; i < 10; i++)
		c.push_back(i);

	for(int i = 0; i < 10; i++)
		std::cout<<c[i]<<" ";
	std::cout<<std::endl;

	return 0;
}
			
//g++ main.cpp -std=c++11
#include <iostream>
#include <vector>

using intContainer = std::vector<int>;

int main(int argc, char *argv[])
{
	intContainer c;
	for(int i = 0; i < 10; i++)
		c.push_back(i);

	for(int i = 0; i < 10; i++)
		std::cout<<c[i]<<" ";
	std::cout<<std::endl;

	return 0;
}
		
#include
#define and #undef
#include <iostream>

#define SIZE 10
#define getMax(a, b) ((a>b)?a:b)

int main(int argc, char *argv[])
{
	std::cout<<SIZE<<std::endl;
	std::cout<<getMax(1, 2)<<std::endl;

	return 0;
}
		
#define str(x) #x
#define glue(a, b) a ## b

#include <iostream>

int main(int argc, char *argv[])
{
	//std::cout<<"Hello World"<<std::endl;
	std::cout<<str(Hello World)<<std::endl;

	using std::cout;
	glue(c, out)<<"Hello World"<<std::endl;

	return 0;
}
	
#ifdef, #ifndef, and #endif
#define PRINT_JOE

#include <iostream>

int main(int argc, char *argv[])
{

#ifdef PRINT_JOE
	std::cout<<"JOE ..."<<std::endl;
#endif

#ifndef PRINT_BOB
	std::cout<<"BOB ..."<<std::endl;
#endif

	return 0;
}
		
#if, #else, and #elif
#define SIZE 150
#include <iostream>

int main(int argc, char *argv[])
{
#if SIZE < 100
#undef SIZE
#define SIZE 100
#elif SIZE < 200
#undef SIZE
#define SIZE 200
#else
#undef SIZE
#define SIZE 300
#endif
	std::cout<<SIZE<<std::endl;

	return 0;
}
		
#line
#include <iostream>

int main(int argc, char *argv[])
{
#line 100
#line 100 "temp.cpp"
	std::cout<<__FILE__<<" "<<__LINE__<<std::endl;

	return 0;
}
		
#error
#ifndef __cplusplus
#error A C++ compiler is required!
#endif

#include <iostream>

int main(int argc, char *argv[])
{
	return 0;
}
		
#pragma
Predefined Macros
#include <iostream>

int main(int argc, char *argv[])
{
	//__LINE__
	std::cout<<__LINE__<<std::endl;

	//__FILE__
	std::cout<<__FILE__<<std::endl;

	//__DATE__
	std::cout<<__DATE__<<std::endl;

	//__TIME__
	std::cout<<__TIME__<<std::endl;

	//__STDC__, signify the compiler conforms to ISO Standard C
	std::cout<<__STDC__<<std::endl;

	//__STDC_HOSTED__, 1 if the implementation is a hosted implementation
	std::cout<<__STDC_HOSTED__<<std::endl;

	//__cplusplus, defined when the C++ compiler is in user
	std::cout<<__cplusplus<<std::endl;

	//__STDCPP_THREADS__, 1 if the program have more than one thread
	//std::cout<<__STDCPP_THREADS__<<std::endl;

	return 0;
}
	
#include <iostream>
#include <typeinfo>

int main(int argc, char *argv[])
{
	//__GNUG__, defined if GNU C++ Compiler is in use
	std::cout<<__GNUG__<<std::endl;

	//__BASE_FILE__
	std::cout<<__BASE_FILE__<<std::endl;

	//__INCLUDE_LEVEL__
	std::cout<<__INCLUDE_LEVEL__<<std::endl;

	//__VERSION__, compiler version
	std::cout<<__VERSION__<<std::endl;

	//__INT8_TYPE__, char
	__INT8_TYPE__ n = 90;
	std::cout<<typeid(n).name()<<" "<<n<<std::endl;

	//and, &&
	//and_eq, &=
	//bitand, &
	//bitor, |
	//compl, ~
	//not, !
	//not_eq, !=
	//or, ||
	//or_eq, |=
	//xor, ^
	//xor_eq, ^=
	if (1 < 2 and 4 > 1)
		std::cout<<"And ..."<<std::endl;

	return 0;
}
Reference