-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1_introduction.cpp
More file actions
79 lines (64 loc) · 1.86 KB
/
1_introduction.cpp
File metadata and controls
79 lines (64 loc) · 1.86 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//one line comment
/*
* Multi line comment
*/
/*
* Tips:
*
* Do comment every functionally (especially functions) what are not 100 % clear what they do
* When you use any functionally from other sources (like stackoverflow) put the source into comment as reference
* Write clean code
* Always think about teh problem first, then start writting the code
* For help use offcial reference: en.cppreference.com
* Coding style: https://stackoverflow.com/questions/18170944/c-coding-style
*
*/
//a library input
//iostream library allows to manipuylate streams = allow to to print outputs and
#include <iostream>
// see more on: https://www.tutorialspoint.com/cplusplus/cpp_namespaces.htm
/*
* For now, most of the functions are store in std namespace
* To access them you have first access this namespace
* You access namespace by declarring is by std::
* By declaring at the beggining use don't have to declare every single function
*/
using namespace std;
/*
* main() is a function where program execution begins
* main has to return an int, therefore at the has be key word return followed by integer
*/
int main() {
/*
* Streams
* ostream cout ~ FILE* stdout
* istream cin ~ FILE* stdin
*
* ostream& ostream::operator<< ()
* istream& istream::operator>> ()
*/
// prints Hello World
cout << "Hello World";
//endl prints a new line
cout << endl;
/*
* data types in C++
* most of the types has unsigned type too
* numeric data types long type on top of that
*/
//boolean
bool flag;
//character - 1B
char ch;
//integer - 4B
int i;
//floating point - 4B
float f;
//double floating point - 8B
double d;
//valueless is void - used mainly in fuctions
cout << "Enter a number" << endl;
//read standart input
cin >> i;
return 0;
}