Skip to content

Commit 1521aad

Browse files
Modifying the C++ post
1 parent b4367de commit 1521aad

File tree

16 files changed

+788
-100
lines changed

16 files changed

+788
-100
lines changed

content/post/cplusplus-coding.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

content/post/cplusplus-working.md renamed to content/post/learning-c++.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
+++
22
author = "mukund"
3-
title = "C++ Working"
3+
title = "Learning C++"
44
date = "2025-05-11"
5-
description = "C++ Working"
5+
description = "Learning C++"
66
tags = [
77
"c++",
88
]
@@ -42,7 +42,7 @@ A <mark>build.sh</mark> file is created that contains the cmake command to confi
4242
cmake -G "CodeLite - Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug
4343
```
4444

45-
### In a C program
45+
### Compiler and Linker
4646

4747
There is a <mark>preprocessor</mark> statement `#include <iostream>`. Any line starting with a `#` would be a preprocessor statement. The <mark>include</mark> preprocessor will copy all the contents of the mentioned file (here iostream) directly into our program file. The preprocessor statement is executed before the compilation starts. Only `.cpp` files are compiled. The `.cpp` files are compiled into `.obj` files.
4848

@@ -64,6 +64,21 @@ If we define a function inside a header file, and then include the same header f
6464

6565
> We can use `static` keyword while declaring the function in the header file. It will mean that the linking to the static function will be internal to the file calling it and separate files will have there own separate versions of that function declared as static.
6666
67+
### Some other preprocessor directives...
68+
69+
```
70+
#pragma once
71+
```
72+
- Prevents the header file from loading multiple times in a single `.cpp` file.
73+
74+
```
75+
#ifndef _LOG_H
76+
```
77+
- Means <mark>execute below statements if `_LOG_H` is not defined</mark>.
78+
- We can define `_LOG_H` using the <mark>define</mark> preprocessor.
79+
80+
---
81+
6782
### References
6883

6984
- [TheCherno - Youtube](https://www.youtube.com/@TheCherno)

public/index.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -159,21 +159,12 @@
159159
class="prose prose-neutral dark:prose-invert relative mx-auto min-h-[calc(100vh-9rem)] max-w-(--w) px-8 pt-14 pb-16"
160160
>
161161

162-
<section class="relative my-10 first-of-type:mt-0 last-of-type:mb-0"><h2 class="my-0!">Coding in C&#43;&#43;</h2>
163-
<time class="text-xs antialiased opacity-60"
164-
>May 12, 2025</time
165-
>
166-
<a class="absolute inset-0 text-[0px]" href="http://localhost:1313/post/cplusplus-coding/"
167-
>Coding in C&#43;&#43;</a
168-
>
169-
</section>
170-
171-
<section class="relative my-10 first-of-type:mt-0 last-of-type:mb-0"><h2 class="my-0!">C&#43;&#43; Working</h2>
162+
<section class="relative my-10 first-of-type:mt-0 last-of-type:mb-0"><h2 class="my-0!">Learning C&#43;&#43;</h2>
172163
<time class="text-xs antialiased opacity-60"
173164
>May 11, 2025</time
174165
>
175-
<a class="absolute inset-0 text-[0px]" href="http://localhost:1313/post/cplusplus-working/"
176-
>C&#43;&#43; Working</a
166+
<a class="absolute inset-0 text-[0px]" href="http://localhost:1313/post/learning-c&#43;&#43;/"
167+
>Learning C&#43;&#43;</a
177168
>
178169
</section>
179170

@@ -247,6 +238,15 @@
247238
<a class="absolute inset-0 text-[0px]" href="http://localhost:1313/post/modsecurity-xss/"
248239
>XSS bypassing ModSecurity WAF</a
249240
>
241+
</section>
242+
243+
<section class="relative my-10 first-of-type:mt-0 last-of-type:mb-0"><h2 class="my-0!">Decoding Digital Personal Data Protection Act For Organizations</h2>
244+
<time class="text-xs antialiased opacity-60"
245+
>Oct 17, 2023</time
246+
>
247+
<a class="absolute inset-0 text-[0px]" href="http://localhost:1313/post/decoding-dpda/"
248+
>Decoding Digital Personal Data Protection Act For Organizations</a
249+
>
250250
</section><nav class="mt-14 flex"><a class="btn not-prose ml-auto" href="/page/2/"
251251
>Next Page→</a
252252
></nav></main><footer

public/index.xml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,13 @@
66
<description>Recent content on devplayer55221</description>
77
<generator>Hugo -- gohugo.io</generator>
88
<language>en-us</language>
9-
<lastBuildDate>Mon, 12 May 2025 00:00:00 +0000</lastBuildDate>
9+
<lastBuildDate>Sun, 11 May 2025 00:00:00 +0000</lastBuildDate>
1010
<atom:link href="http://localhost:1313/index.xml" rel="self" type="application/rss+xml" />
1111
<item>
12-
<title>Coding in C&#43;&#43;</title>
13-
<link>http://localhost:1313/post/cplusplus-coding/</link>
14-
<pubDate>Mon, 12 May 2025 00:00:00 +0000</pubDate>
15-
<guid>http://localhost:1313/post/cplusplus-coding/</guid>
16-
<description>#pragma once This code prevents the header file from loading multiple times in a single .cpp file.&#xA;#ifndef _LOG_H This code means &amp;rsquo;execute below statements if _LOG_H is not defined&#39;.</description>
17-
</item>
18-
<item>
19-
<title>C&#43;&#43; Working</title>
20-
<link>http://localhost:1313/post/cplusplus-working/</link>
12+
<title>Learning C&#43;&#43;</title>
13+
<link>http://localhost:1313/post/learning-c&#43;&#43;/</link>
2114
<pubDate>Sun, 11 May 2025 00:00:00 +0000</pubDate>
22-
<guid>http://localhost:1313/post/cplusplus-working/</guid>
15+
<guid>http://localhost:1313/post/learning-c&#43;&#43;/</guid>
2316
<description>I was just learning about the C++ fundamentals from The Cherno C++ playlist and thought of making notes on it. Added reference at the bottom.&#xA;What’s cmake? CMake is an open-source, cross-platform build system generator. It doesn’t build software directly—it generates build files (like Makefiles, Ninja build files, or Visual Studio project files) based on the instructions present in CMakeLists.txt.&#xA;cmake_minimum_required (VERSION 3.5) project (HelloWorld) set (CMAKE_CXX_FLAGS &amp;#34;${CMAKE_CXX_FLAGS} -Wall -Werror -std=c++14&amp;#34;) set (source_dir &amp;#34;${PROJECT_SOURCE_DIR}/src/&amp;#34;) file(GLOB source_files &amp;#34;${source_dir}/*.</description>
2417
</item>
2518
<item>

public/page/2/index.html

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -159,15 +159,6 @@
159159
class="prose prose-neutral dark:prose-invert relative mx-auto min-h-[calc(100vh-9rem)] max-w-(--w) px-8 pt-14 pb-16"
160160
>
161161

162-
<section class="relative my-10 first-of-type:mt-0 last-of-type:mb-0"><h2 class="my-0!">Decoding Digital Personal Data Protection Act For Organizations</h2>
163-
<time class="text-xs antialiased opacity-60"
164-
>Oct 17, 2023</time
165-
>
166-
<a class="absolute inset-0 text-[0px]" href="http://localhost:1313/post/decoding-dpda/"
167-
>Decoding Digital Personal Data Protection Act For Organizations</a
168-
>
169-
</section>
170-
171162
<section class="relative my-10 first-of-type:mt-0 last-of-type:mb-0"><h2 class="my-0!">HackTheBox Business CTF 2023 – Crypto</h2>
172163
<time class="text-xs antialiased opacity-60"
173164
>Jul 26, 2023</time

public/post/burp-ext-checksum/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ <h1 class="my-0! pb-2.5">Writing a Burp Extension to Bypass Checksum</h1><div cl
181181
>web</a
182182
></footer><nav
183183
class="mt-24 flex overflow-hidden rounded-xl bg-black/[3%] text-lg leading-[1.2]! *:flex *:w-1/2 *:items-center *:p-5 *:font-medium *:no-underline dark:bg-white/[8%] [&>*:hover]:bg-black/[2%] dark:[&>*:hover]:bg-white/[3%]"
184-
><a class="ltr:pr-3 rtl:pl-3" href="http://localhost:1313/post/cplusplus-working/"
185-
><span class="ltr:mr-1.5 rtl:ml-1.5"></span><span>C&#43;&#43; Working</span></a
184+
><a class="ltr:pr-3 rtl:pl-3" href="http://localhost:1313/post/learning-c&#43;&#43;/"
185+
><span class="ltr:mr-1.5 rtl:ml-1.5"></span><span>Learning C&#43;&#43;</span></a
186186
><a
187187
class="justify-end pl-3 ltr:ml-auto rtl:mr-auto"
188188
href="http://localhost:1313/post/stream-cipher/"

public/post/cplusplus-coding/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
/>
2121

2222

23-
<title>Coding in C&#43;&#43; - devplayer55221</title>
23+
<title>Learning C&#43;&#43; - 2 - devplayer55221</title>
2424

2525

2626
<meta name="theme-color" />
@@ -160,7 +160,7 @@
160160
class="prose prose-neutral dark:prose-invert relative mx-auto min-h-[calc(100vh-9rem)] max-w-(--w) px-8 pt-14 pb-16"
161161
><article>
162162
<header class="mb-14">
163-
<h1 class="my-0! pb-2.5">Coding in C&#43;&#43;</h1><div class="text-xs antialiased opacity-60"><time>May 12, 2025</time><span class="mx-1">&middot;</span>
163+
<h1 class="my-0! pb-2.5">Learning C&#43;&#43; - 2</h1><div class="text-xs antialiased opacity-60"><time>May 12, 2025</time><span class="mx-1">&middot;</span>
164164
<span>mukund</span></div></header>
165165

166166
<section><pre tabindex="0"><code>#pragma once
@@ -178,7 +178,7 @@ <h1 class="my-0! pb-2.5">Coding in C&#43;&#43;</h1><div class="text-xs antialias
178178
><a
179179
class="justify-end pl-3 ltr:ml-auto rtl:mr-auto"
180180
href="http://localhost:1313/post/cplusplus-working/"
181-
><span>C&#43;&#43; Working</span><span class="ltr:ml-1.5 rtl:mr-1.5"></span></a
181+
><span>Learning C&#43;&#43; - 1</span><span class="ltr:ml-1.5 rtl:mr-1.5"></span></a
182182
></nav></article></main><footer
183183
class="mx-auto flex h-[4.5rem] max-w-(--w) items-center px-8 text-xs tracking-wider uppercase opacity-60"
184184
>

public/post/cplusplus-working/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
/>
2121

2222

23-
<title>C&#43;&#43; Working - devplayer55221</title>
23+
<title>Learning C&#43;&#43; - 1 - devplayer55221</title>
2424

2525

2626
<meta name="theme-color" />
@@ -161,7 +161,7 @@
161161
class="prose prose-neutral dark:prose-invert relative mx-auto min-h-[calc(100vh-9rem)] max-w-(--w) px-8 pt-14 pb-16"
162162
><article>
163163
<header class="mb-14">
164-
<h1 class="my-0! pb-2.5">C&#43;&#43; Working</h1><div class="text-xs antialiased opacity-60"><time>May 11, 2025</time><span class="mx-1">&middot;</span>
164+
<h1 class="my-0! pb-2.5">Learning C&#43;&#43; - 1</h1><div class="text-xs antialiased opacity-60"><time>May 11, 2025</time><span class="mx-1">&middot;</span>
165165
<span>mukund</span></div></header>
166166

167167
<section><p>I was just learning about the C++ fundamentals from <strong>The Cherno</strong> C++ playlist and thought of making notes on it. Added reference at the bottom.</p>
@@ -222,8 +222,8 @@ <h3 id="references">References</h3>
222222
>c&#43;&#43;</a
223223
></footer><nav
224224
class="mt-24 flex overflow-hidden rounded-xl bg-black/[3%] text-lg leading-[1.2]! *:flex *:w-1/2 *:items-center *:p-5 *:font-medium *:no-underline dark:bg-white/[8%] [&>*:hover]:bg-black/[2%] dark:[&>*:hover]:bg-white/[3%]"
225-
><a class="ltr:pr-3 rtl:pl-3" href="http://localhost:1313/post/cplusplus-coding/"
226-
><span class="ltr:mr-1.5 rtl:ml-1.5"></span><span>Coding in C&#43;&#43;</span></a
225+
><a class="ltr:pr-3 rtl:pl-3" href="http://localhost:1313/post/learning-c&#43;&#43;-2/"
226+
><span class="ltr:mr-1.5 rtl:ml-1.5"></span><span>Learning C&#43;&#43; - 2</span></a
227227
><a
228228
class="justify-end pl-3 ltr:ml-auto rtl:mr-auto"
229229
href="http://localhost:1313/post/burp-ext-checksum/"

public/post/index.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -159,21 +159,12 @@
159159
class="prose prose-neutral dark:prose-invert relative mx-auto min-h-[calc(100vh-9rem)] max-w-(--w) px-8 pt-14 pb-16"
160160
>
161161

162-
<section class="relative my-10 first-of-type:mt-0 last-of-type:mb-0"><h2 class="my-0!">Coding in C&#43;&#43;</h2>
163-
<time class="text-xs antialiased opacity-60"
164-
>May 12, 2025</time
165-
>
166-
<a class="absolute inset-0 text-[0px]" href="http://localhost:1313/post/cplusplus-coding/"
167-
>Coding in C&#43;&#43;</a
168-
>
169-
</section>
170-
171-
<section class="relative my-10 first-of-type:mt-0 last-of-type:mb-0"><h2 class="my-0!">C&#43;&#43; Working</h2>
162+
<section class="relative my-10 first-of-type:mt-0 last-of-type:mb-0"><h2 class="my-0!">Learning C&#43;&#43;</h2>
172163
<time class="text-xs antialiased opacity-60"
173164
>May 11, 2025</time
174165
>
175-
<a class="absolute inset-0 text-[0px]" href="http://localhost:1313/post/cplusplus-working/"
176-
>C&#43;&#43; Working</a
166+
<a class="absolute inset-0 text-[0px]" href="http://localhost:1313/post/learning-c&#43;&#43;/"
167+
>Learning C&#43;&#43;</a
177168
>
178169
</section>
179170

@@ -247,6 +238,15 @@
247238
<a class="absolute inset-0 text-[0px]" href="http://localhost:1313/post/modsecurity-xss/"
248239
>XSS bypassing ModSecurity WAF</a
249240
>
241+
</section>
242+
243+
<section class="relative my-10 first-of-type:mt-0 last-of-type:mb-0"><h2 class="my-0!">Decoding Digital Personal Data Protection Act For Organizations</h2>
244+
<time class="text-xs antialiased opacity-60"
245+
>Oct 17, 2023</time
246+
>
247+
<a class="absolute inset-0 text-[0px]" href="http://localhost:1313/post/decoding-dpda/"
248+
>Decoding Digital Personal Data Protection Act For Organizations</a
249+
>
250250
</section><nav class="mt-14 flex"><a class="btn not-prose ml-auto" href="/post/page/2/"
251251
>Next Page→</a
252252
></nav></main><footer

public/post/index.xml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,13 @@
66
<description>Recent content in Posts on devplayer55221</description>
77
<generator>Hugo -- gohugo.io</generator>
88
<language>en-us</language>
9-
<lastBuildDate>Mon, 12 May 2025 00:00:00 +0000</lastBuildDate>
9+
<lastBuildDate>Sun, 11 May 2025 00:00:00 +0000</lastBuildDate>
1010
<atom:link href="http://localhost:1313/post/index.xml" rel="self" type="application/rss+xml" />
1111
<item>
12-
<title>Coding in C&#43;&#43;</title>
13-
<link>http://localhost:1313/post/cplusplus-coding/</link>
14-
<pubDate>Mon, 12 May 2025 00:00:00 +0000</pubDate>
15-
<guid>http://localhost:1313/post/cplusplus-coding/</guid>
16-
<description></description>
17-
</item>
18-
<item>
19-
<title>C&#43;&#43; Working</title>
20-
<link>http://localhost:1313/post/cplusplus-working/</link>
12+
<title>Learning C&#43;&#43;</title>
13+
<link>http://localhost:1313/post/learning-c&#43;&#43;/</link>
2114
<pubDate>Sun, 11 May 2025 00:00:00 +0000</pubDate>
22-
<guid>http://localhost:1313/post/cplusplus-working/</guid>
15+
<guid>http://localhost:1313/post/learning-c&#43;&#43;/</guid>
2316
<description>I was just learning about the C++ fundamentals from The Cherno C++ playlist and thought of making notes on it. Added reference at the bottom.&#xA;What’s cmake? CMake is an open-source, cross-platform build system generator. It doesn’t build software directly—it generates build files (like Makefiles, Ninja build files, or Visual Studio project files) based on the instructions present in CMakeLists.txt.&#xA;cmake_minimum_required (VERSION 3.5) project (HelloWorld) set (CMAKE_CXX_FLAGS &amp;#34;${CMAKE_CXX_FLAGS} -Wall -Werror -std=c++14&amp;#34;) set (source_dir &amp;#34;${PROJECT_SOURCE_DIR}/src/&amp;#34;) file(GLOB source_files &amp;#34;${source_dir}/*.</description>
2417
</item>
2518
<item>

0 commit comments

Comments
 (0)