blob: 32ef22fade7a0eff2063a950ca668799eac6c47f (
plain) (
blame)
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
|
#include <iostream>
using namespace std; // Specifies that you don't need to use "std::" before a object.
void noReturn() // "void" means you DON'T want anything returned from the function.
{
// Code
}; // Put ";" after } to signify the end of a function.
int yesReturn() // "int" means you WANT something to be returned.
{
return 0; // "return 0;" basically just means "exit".
};
class Example // A "class" is a user-defined data structure.
{
// Class Access Modifiers.
public:
// Everyone can see it.
protected:
// Package Private + can be seen by subclasses or package member.
private:
// Like you'd think, only the class in which it is declared can see it.
};
int main()
{
// Initializing main functions.
noReturn();
yesReturn();
system("pause"); // "Press any key to continue" function.
}
|