Skip to content

Commit 0168ef3

Browse files
author
Dimitrios Desyllas (pc_magas)
committed
Removing Namespace
1 parent 78b2d9e commit 0168ef3

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

Basic/swhichCase.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include <iostream>
22
#include <cstring>
3-
using namespace std;
43

54
const char RED[8]="\033[0;31m";
65
const char GREEN[8]="\033[0;32m";
@@ -33,17 +32,17 @@ int main()
3332
}
3433

3534
void print_start_message(){
36-
cout<<"Select a color"<<endl;
37-
cout<<RED<<OPTION_RED<<") red"<<NO_COLOR<<endl;
38-
cout<<GREEN<<OPTION_GREEN<<") green"<<NO_COLOR<<endl;
39-
cout<<YELLOW<<OPTION_YELLOW<<") yellow"<<NO_COLOR<<endl;
35+
std::cout<<"Select a color"<<std::endl;
36+
std::cout<<RED<<OPTION_RED<<") red"<<NO_COLOR<<std::endl;
37+
std::cout<<GREEN<<OPTION_GREEN<<") green"<<NO_COLOR<<std::endl;
38+
std::cout<<YELLOW<<OPTION_YELLOW<<") yellow"<<NO_COLOR<<std::endl;
4039
}
4140

4241
int get_option(){
4342
int option=0;
4443
do {
4544
print_start_message();
46-
cin>>option;
45+
std::cin>>option;
4746
} while(option==0 || option > OPTION_YELLOW);
4847
return option;
4948
}
@@ -67,6 +66,6 @@ void print_message_with_color(int selectedColor) {
6766
break; //useless but usefull when needed to put antother option
6867
}
6968

70-
cout<<color_to_print<<"Hello Colored World"<<NO_COLOR<<endl;
71-
cout<<NO_COLOR;
69+
std::cout<<color_to_print<<"Hello Colored World"<<NO_COLOR<<std::endl;
70+
std::cout<<NO_COLOR;
7271
}

0 commit comments

Comments
 (0)