Skip to content
This repository was archived by the owner on Apr 21, 2024. It is now read-only.

Commit 61606f4

Browse files
committed
first commit
0 parents  commit 61606f4

File tree

478 files changed

+24005
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

478 files changed

+24005
-0
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.vscode
2+
.exe
3+
4+
# build directories
5+
.DS_STORE
6+
.idea/
7+
config.log
8+
target/
9+
_build/

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# read_cpp_primer

TT_Primer_note.pdf

50.8 MB
Binary file not shown.

ch1/0_check_version.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include<iostream>
2+
using namespace std;
3+
4+
int main() {
5+
if (__cplusplus == 201703L) {
6+
cout << "C++17\n";
7+
} else if (__cplusplus == 201402L) {
8+
cout << "C++14\n";
9+
} else if (__cplusplus == 201103L) {
10+
cout << "C++11\n";
11+
} else if (__cplusplus == 199711L) {
12+
cout << "C++98\n";
13+
} else {
14+
cout << "pre-standard C++\n";
15+
}
16+
return 0;
17+
}

ch1/0_check_version.exe

44.9 KB
Binary file not shown.

ch1/1_io.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include<iostream>
2+
using namespace std;
3+
4+
int main() {
5+
cout << "This is an normal output\n";
6+
cerr << "This is an error\n";
7+
clog << "This is a log\n";
8+
return 0;
9+
}

ch1/1_io.exe

44.9 KB
Binary file not shown.

ch1/2_comments.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include<iostream>
2+
using namespace std;
3+
4+
//
5+
// If you have nested comment pairs, compiler gives the following error message:
6+
//
7+
// 2_comments.cpp:7:3: error: expected unqualified-id before '/' token
8+
// */
9+
// ^
10+
//
11+
12+
13+
int main() {
14+
cout << "/*";
15+
cout << "*/";
16+
// cout << /* "*/" */ ;
17+
cout << /* "*/" /* "/*" */;
18+
return 0;
19+
}

ch1/2_comments.exe

44.5 KB
Binary file not shown.

ch1/3_unknownNumberInputs.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
int main() {
5+
cout << "The way to generate end-of-file through keyboard: press Ctrl+Z and then press Enter.\n";
6+
7+
int sum = 0;
8+
int val = 0;
9+
cout << "Enter as many integers as you like to get the sum: \n";
10+
while ( cin >> val){
11+
sum += val;
12+
}
13+
14+
cout << "Sum: " << sum;
15+
}

0 commit comments

Comments
 (0)