-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcpp.html
More file actions
140 lines (120 loc) · 4.38 KB
/
Copy pathcpp.html
File metadata and controls
140 lines (120 loc) · 4.38 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>C++ Basics</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 40px 20px;
background: linear-gradient(135deg, #000000, #1a1a80, #4b0082);
background-size: 400% 400%;
animation: gradientBG 15s ease infinite;
color: #eeeeee;
}
@keyframes gradientBG {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}
h1, h2 {
color: #c3a6ff;
}
a {
color: #66ffe0;
text-decoration: underline;
}
pre {
background-color: #1c1c2b;
padding: 15px;
border-radius: 8px;
border: 1px solid #555;
overflow-x: auto;
}
code {
font-family: Consolas, "Courier New", monospace;
color: #aaffff;
}
.home-button {
position: absolute;
top: 20px;
left: 20px;
}
.home-button a {
text-decoration: none;
background-color: #222;
color: white;
padding: 10px 18px;
border-radius: 6px;
font-size: 16px;
border: 1px solid #666;
}
.home-button a:hover {
background-color: #333;
}
section {
margin-bottom: 40px;
}
p {
font-size: 17px;
line-height: 1.6;
}
ul {
padding-left: 20px;
}
li {
margin-bottom: 10px;
}
</style>
</head>
<body>
<!-- Home Button -->
<div class="home-button">
<a href="index.html">HOME</a>
</div>
<!-- INTRO -->
<section>
<h1>Learn C++ Programming</h1>
<hr>
<p>C++ is a high-performance, general-purpose programming language widely used in system/software development, game development, and competitive programming. It combines the speed of C with object-oriented features, making it both powerful and flexible.</p>
</hr>
</section>
<!-- INSTALLATION -->
<section>
<hr>
<h2>🔧 How to Install a Lightweight C++ Compiler</h2>
</hr>
<p>Here are free and lightweight ways to write and run C++ code on different devices:</p>
<ul>
<li><strong>Windows:</strong> Install <a href="https://code.visualstudio.com/" target="_blank">VS Code</a> + <a href="https://www.mingw-w64.org/" target="_blank">MinGW Compiler</a> (recommended combo).</li>
<li><strong>Linux:</strong> Use terminal to install G++:<br><code>sudo apt install g++</code></li>
<li><strong>Android:</strong> Use the app <a href="https://play.google.com/store/apps/details?id=com.iodevs.cppdroid" target="_blank">C++Droid</a> from Play Store.</li>
<li><strong>iOS:</strong> Use <a href="https://apps.apple.com/us/app/cpp-programming/id6443452316" target="_blank">C++ Programming</a> from App Store (limited support).</li>
<li><strong>Online (Any Device):</strong> Try <a href="https://www.programiz.com/cpp-programming/online-compiler/" target="_blank">Programiz Online Compiler</a> or <a href="https://cpp.sh/" target="_blank">cpp.sh</a>.</li>
</ul><hr>
</section>
<!-- SAMPLE CODE -->
<section>
</hr><h2>🧪 Simple Test Code</h2><hr>
<p>This is a basic C++ program that displays <code>Hello, World!</code> in the output. Perfect to test if everything works:</p>
<pre><code>// Simple C++ Program
#include <iostream>
using namespace std;
int main() {
cout << "Hello, World!" << endl;
return 0;
}
</code></pre>
</hr>
<p><strong>Explanation:</strong></p>
<ul>
<li><code>#include <iostream></code> lets you use input/output functions like <code>cout</code>.</li>
<li><code>using namespace std;</code> avoids writing <code>std::cout</code> every time.</li>
<li><code>main()</code> is the entry point of the program.</li>
<li><code>cout << "Hello, World!"</code> displays the message.</li>
</ul>
</section>
</body>
</html>