-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasicstrings.cpp
More file actions
63 lines (45 loc) · 1.05 KB
/
basicstrings.cpp
File metadata and controls
63 lines (45 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include <iostream>
#include <string>
//using namespace std;
void Print(std::string str);
void Print(int str);
void Print(std::string str1 , std::string str2);
void CanPassLiterals(const int& in);
int main()
{
const float PI = 3.14159;
std::cout << PI << std::endl;
Print("ahmed");
Print(5);
Print("Ahmed", "Sabry");
char MyCstring[5] = { 'D','o','g','s','\0' };
Print(" \n", MyCstring);
std::string mystr1 = "Aha";
std::string mystr2 = " yo!";
std::string sentence = " ";
sentence += "\n" + mystr1 + mystr2;
Print(sentence);
CanPassLiterals(5);
int a = 50;
int b = 100;
if (a < b && a < 1000) {
std::cout << " \n a > b but still less than 1000" << std::endl;
}
if (a > b || a < 1000) {
std::cout << " \n a is not > b however it is less than 1000" << std::endl;
}
}
void CanPassLiterals(const int& i) {
std::cout << i;
}
void Print(std::string str)
{
std::cout << str << std::endl;
}
void Print(int str)
{
std::cout << str << std::endl;
}
void Print(std::string str1, std::string str2) {
std::cout << str1 << " " << str2;
}