blob: 2e11bcaed05d8fc05d985e2a22f35aecf38c8a33 (
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
41
|
#include <iostream>
using namespace std; // Specifies that you don't need to use "std::" before a object.
// More info about the standard or "std" C++ library here; http://www.cplusplus.com/forum/beginner/61121/
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.
}
|