-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
67 lines (48 loc) · 1.08 KB
/
main.cpp
File metadata and controls
67 lines (48 loc) · 1.08 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
64
65
#include <iostream>
#include <fstream>
#include <string>
#include <cstring>
using namespace std;
#define BLUE cout << "\033[0;34m";
#define GREEN cout << "\033[0;32m";
#define WHITE cout << "\033[0;37m";
void chat();
int main() {
WHITE
string user1;
string user2;
string chat;
cout << "User One: ";
cin >> user1;
cout << "User Two: ";
cin >> user2;
cout << "Chat name: ";
cin >> chat;
cout << "\t\t\t" << chat << endl;
if (user1.length() > 10 || user2.length() > 10) {
cout << "Character Limit(10) Exceeded! \n";
main();
}
if (chat.length() > 10) {
cout << "Character Limit(10) Exceeded! \n";
main();
}
while (true) {
char message1[100];
char message2[100];
string message1cpy = message1;
string message2cpy = message2;
WHITE
cout << user1 << ": ";
cin.getline(message1, 100);
cout << "👤 " << user1 << ": ";
BLUE
cout << message1 << endl;
WHITE
cout << user2 << ": ";
cin.getline(message2, 100);
cout << "👤 " << user2 << ": ";
GREEN
cout << message2 << endl;
}
}