1#include <iostream>
2
3using namespace std;
4
5int main()
6{
7 cout << "Hello World";
8 system("pause");
9 return 0;
10
11}
1//namespace is a declarative region to provide scope for identifiers
2#include <bits/stdc++.h>
3
4using namespace std; //including namespace std for cin and cout
5//my custom namespace for variables and functions
6namespace abc
7{
8 void fun()
9 {
10 cout<<"Hello world"<<endl;
11 }
12 int x=10;
13}
14using namespace abc;
15int main()
16{
17 cout<<10;
18 fun();
19 return 0;
20}
1#include <iostream>
2using namespace std;
3namespace square{
4 int x;
5 int y;
6}
7int main(){
8 using namespace square;
9 x = 10;
10 y = 0;
11 cout << x << y << endl;
12}
1namespace Parent
2{
3 inline namespace new_ns
4 {
5 template <typename T>
6 struct C
7 {
8 T member;
9 };
10 }
11 template<>
12 class C<int> {};
13}
14