Skip to content

Commit

Permalink
first
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee committed Apr 9, 2018
0 parents commit 6401c24
Show file tree
Hide file tree
Showing 13 changed files with 714 additions and 0 deletions.
76 changes: 76 additions & 0 deletions chapter_1/.vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"configurations": [
{
"name": "Mac",
"includePath": [
"/usr/include",
"/usr/local/include",
"${workspaceRoot}"
],
"defines": [],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"/usr/include",
"/usr/local/include",
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
},
"macFrameworkPath": [
"/System/Library/Frameworks",
"/Library/Frameworks"
]
},
{
"name": "Linux",
"includePath": [
"/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5",
"/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/x86_64-redhat-linux",
"/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/backward",
"/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include",
"/usr/local/include",
"/usr/include",
"${workspaceRoot}"
],
"defines": [],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5",
"/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/x86_64-redhat-linux",
"/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/backward",
"/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include",
"/usr/local/include",
"/usr/include",
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
},
{
"name": "Win32",
"includePath": [
"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include",
"${workspaceRoot}"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"intelliSenseMode": "msvc-x64",
"browse": {
"path": [
"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include/*",
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
],
"version": 3
}
31 changes: 31 additions & 0 deletions chapter_1/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
// https://github.com/Microsoft/vscode-cpptools/blob/master/launch.md
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/a.out",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
//"internalConsoleOptions": "neverOpen",
"preLaunchTask": "main",
"additionalSOLibSearchPath": ""
}
]
}
9 changes: 9 additions & 0 deletions chapter_1/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"files.associations": {
"iostream": "cpp",
"ostream": "cpp",
"cmath": "cpp",
"climits": "cpp",
"cfloat": "cpp"
}
}
23 changes: 23 additions & 0 deletions chapter_1/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "main",
"type": "shell",
"command": "g++",
"args": [
"-g",
"-std=c++11",
"-Wall",
"main.cpp"
],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": []
}
]
}
Binary file added chapter_1/a.out
Binary file not shown.
82 changes: 82 additions & 0 deletions chapter_1/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#include <iostream>
#include <cmath>
#include <climits>
#include <cfloat>

using namespace std;

int climits_test(void);
int cPlusPlus_init(void);
int flaotnum(void);

int main()
{
cout.setf(ios_base::fixed, ios_base::floatfield);

//long a = 11111111111111;
const int b = 1;
int a = 2000;
char c = {a};
cout << "a + b = " << c << endl;


//flaotnum();
//climits_test();
//cPlusPlus_init();

cin.get();
return 0;
}

int climits_test(void)
{
char n_char = CHAR_BIT;
int n_int_max = INT_MAX;
int n_int_min = INT_MIN;

cout << "sizeof (n_char): " << sizeof (n_char) << endl;
cout << "CHAR_BIT: " << CHAR_BIT << endl;

cout << "sizeof (short): " << sizeof (short) << endl;
//cout << "SHORT_MAX: " << SHORT_MAX << endl;

cout << "sizeof (n_int_max): " << sizeof n_int_max << endl;
cout << "INT_MAX: " << INT_MAX << endl;

cout << "sizeof (n_int_min): " << sizeof (n_int_min) << endl;
cout << "INT_MIN: " << INT_MIN << endl;

cout << "sizeof (long): " << sizeof (long) << endl;
cout << "LONG_MAX: " << LONG_MAX << endl;

return 0;
}

int cPlusPlus_init(void)
{
int a = {};
int b = {5};
int c{};

cout << "a: " << a << endl
<< "b: " << b << endl
<< "c: " << c << endl;
return 0;
}

int flaotnum(void)
{
using namespace std;
cout.setf(ios_base::fixed, ios_base::floatfield);
float tub = 10.0 / 3.0;
double mint = 10.0 / 3.0;
const float million = 1.0e6;

cout << "tub = " << tub;
cout << ", amillion tub = " << million * tub;
cout << ", \nand ten million tube = " << 10 * million * tub;
cout << "\nmint = " << mint << " and a million minte = ";
cout << million * mint << endl;
return 0;

}
79 changes: 79 additions & 0 deletions chapter_2/.vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"configurations": [
{
"name": "Mac",
"includePath": [
"/usr/include",
"/usr/local/include",
"${workspaceRoot}"
],
"defines": [],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"/usr/include",
"/usr/local/include",
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
},
"macFrameworkPath": [
"/System/Library/Frameworks",
"/Library/Frameworks"
]
},
{
"name": "Linux",
"includePath": [
"/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5",
"/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/x86_64-redhat-linux",
"/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/backward",
"/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include",
"/usr/local/include",
"/usr/include",
"${workspaceRoot}"
],
"defines": [],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5",
"/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/x86_64-redhat-linux",
"/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/backward",
"/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include",
"/usr/local/include",
"/usr/include",
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
},
"compilerPath": "/usr/bin/gcc",
"cStandard": "c11",
"cppStandard": "c++14"
},
{
"name": "Win32",
"includePath": [
"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include",
"${workspaceRoot}"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"intelliSenseMode": "msvc-x64",
"browse": {
"path": [
"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include/*",
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
],
"version": 3
}
31 changes: 31 additions & 0 deletions chapter_2/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
// https://github.com/Microsoft/vscode-cpptools/blob/master/launch.md
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/a.out",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
//"internalConsoleOptions": "neverOpen",
"preLaunchTask": "main",
"additionalSOLibSearchPath": ""
}
]
}
11 changes: 11 additions & 0 deletions chapter_2/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"files.associations": {
"iostream": "cpp",
"ostream": "cpp",
"cmath": "cpp",
"climits": "cpp",
"cfloat": "cpp",
"array": "cpp",
"istream": "cpp"
}
}
23 changes: 23 additions & 0 deletions chapter_2/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "main",
"type": "shell",
"command": "g++",
"args": [
"-g",
"-std=c++11",
"-Wall",
"main.cpp"
],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": []
}
]
}
Binary file added chapter_2/a.out
Binary file not shown.
1 change: 1 addition & 0 deletions chapter_2/carinfo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Make and model!
Loading

0 comments on commit 6401c24

Please sign in to comment.