|
| 1 | +<!doctype html> |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | +<html |
| 10 | + class="not-ready lg:text-base" |
| 11 | + style="--bg:#faf8f1" |
| 12 | + lang="en-us" |
| 13 | + dir="ltr" |
| 14 | +><head><script src="/livereload.js?mindelay=10&v=2&port=1313&path=livereload" data-no-instant defer></script> |
| 15 | + <meta charset="utf-8" /> |
| 16 | + <meta http-equiv="X-UA-Compatible" content="IE=edge" /> |
| 17 | + <meta |
| 18 | + name="viewport" |
| 19 | + content="width=device-width, initial-scale=1, shrink-to-fit=no" |
| 20 | + /> |
| 21 | + |
| 22 | + |
| 23 | + <title>Coding in C++ - devplayer55221</title> |
| 24 | + |
| 25 | + |
| 26 | + <meta name="theme-color" /> |
| 27 | + |
| 28 | + <meta name="description" content="#pragma once This code prevents the header file from loading multiple times in a single .cpp file. |
| 29 | +#ifndef _LOG_H This code means ’execute below statements if _LOG_H is not defined'." /> |
| 30 | + <meta name="author" content="mukund" /><link rel="preload stylesheet" as="style" href="http://localhost:1313/main.min.css" /> |
| 31 | + |
| 32 | + |
| 33 | + <link rel="preload" as="image" href="http://localhost:1313/theme.png" /> |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + <link rel="preload" as="image" href="http://localhost:1313/twitter.svg" /><link rel="preload" as="image" href="http://localhost:1313/github.svg" /><link rel="preload" as="image" href="http://localhost:1313/linkedin.svg" /> |
| 38 | + |
| 39 | + <script |
| 40 | + defer |
| 41 | + src="http://localhost:1313/highlight.min.js" |
| 42 | + onload="hljs.initHighlightingOnLoad();" |
| 43 | + ></script> |
| 44 | + |
| 45 | + |
| 46 | + <link |
| 47 | + rel="icon" |
| 48 | + href="http://localhost:1313/favicon.ico" |
| 49 | + /> |
| 50 | + <link |
| 51 | + rel="apple-touch-icon" |
| 52 | + href="http://localhost:1313/apple-touch-icon.png" |
| 53 | + /> |
| 54 | + |
| 55 | + <meta name="generator" content="Hugo 0.123.7"> |
| 56 | +</head> |
| 57 | +<body |
| 58 | + class="bg-(--bg) text-black antialiased duration-200 ease-out [-webkit-tap-highlight-color:transparent] dark:text-white" |
| 59 | + ><header |
| 60 | + class="mx-auto flex h-[4.5rem] max-w-(--w) px-8 whitespace-nowrap lg:justify-center" |
| 61 | +> |
| 62 | + <div class="relative z-50 flex items-center ltr:mr-auto rtl:ml-auto"> |
| 63 | + <a |
| 64 | + class="-translate-y-[1px] text-2xl font-medium" |
| 65 | + href="http://localhost:1313/" |
| 66 | + >devplayer55221</a |
| 67 | + > |
| 68 | + <div |
| 69 | + class="btn-dark text-[0px] ltr:ml-4 rtl:mr-4 h-6 w-6 shrink-0 cursor-pointer [background:url(./theme.png)_left_center/_auto_theme('spacing.6')_no-repeat] [transition:_background-position_0.4s_steps(5)] dark:[background-position:right]" |
| 70 | + role="button" |
| 71 | + aria-label="Dark" |
| 72 | + ></div> |
| 73 | + </div> |
| 74 | + |
| 75 | + <div |
| 76 | + class="btn-menu relative z-50 flex h-[4.5rem] w-[5rem] shrink-0 cursor-pointer flex-col items-center justify-center gap-2.5 lg:hidden ltr:-mr-8 rtl:-ml-8" |
| 77 | + role="button" |
| 78 | + aria-label="Menu" |
| 79 | + ></div> |
| 80 | + |
| 81 | + <script> |
| 82 | + |
| 83 | + const htmlClass = document.documentElement.classList; |
| 84 | + setTimeout(() => { |
| 85 | + htmlClass.remove('not-ready'); |
| 86 | + }, 10); |
| 87 | + |
| 88 | + |
| 89 | + const btnMenu = document.querySelector('.btn-menu'); |
| 90 | + btnMenu.addEventListener('click', () => { |
| 91 | + htmlClass.toggle('open'); |
| 92 | + }); |
| 93 | + |
| 94 | + |
| 95 | + const metaTheme = document.querySelector('meta[name="theme-color"]'); |
| 96 | + const lightBg = '#faf8f1'.replace(/"/g, ''); |
| 97 | + const setDark = (isDark) => { |
| 98 | + metaTheme.setAttribute('content', isDark ? '#000' : lightBg); |
| 99 | + htmlClass[isDark ? 'add' : 'remove']('dark'); |
| 100 | + localStorage.setItem('dark', isDark); |
| 101 | + }; |
| 102 | + |
| 103 | + |
| 104 | + const darkScheme = window.matchMedia('(prefers-color-scheme: dark)'); |
| 105 | + if (htmlClass.contains('dark')) { |
| 106 | + setDark(true); |
| 107 | + } else { |
| 108 | + const darkVal = localStorage.getItem('dark'); |
| 109 | + setDark(darkVal ? darkVal === 'true' : darkScheme.matches); |
| 110 | + } |
| 111 | + |
| 112 | + |
| 113 | + darkScheme.addEventListener('change', (event) => { |
| 114 | + setDark(event.matches); |
| 115 | + }); |
| 116 | + |
| 117 | + |
| 118 | + const btnDark = document.querySelector('.btn-dark'); |
| 119 | + btnDark.addEventListener('click', () => { |
| 120 | + setDark(localStorage.getItem('dark') !== 'true'); |
| 121 | + }); |
| 122 | + </script> |
| 123 | + |
| 124 | + <div |
| 125 | + class="nav-wrapper fixed inset-x-0 top-full z-40 flex h-full flex-col justify-center bg-(--bg) pb-16 duration-200 select-none lg:static lg:h-auto lg:flex-row lg:bg-transparent! lg:pb-0 lg:transition-none" |
| 126 | + ><nav |
| 127 | + class="lg:ml-12 lg:flex lg:flex-row lg:items-center lg:space-x-10 rtl:space-x-reverse" |
| 128 | + ><a |
| 129 | + class="block text-center text-xl leading-[5rem] lg:text-base lg:font-normal" |
| 130 | + href="/about/" |
| 131 | + >About</a |
| 132 | + ></nav><nav |
| 133 | + class="mt-12 flex justify-center space-x-10 lg:mt-0 lg:items-center ltr:lg:ml-14 rtl:space-x-reverse rtl:lg:mr-14 dark:invert" |
| 134 | + > |
| 135 | + <a |
| 136 | + class="h-7 w-7 text-[0px] [background:var(--url)_center_center/cover_no-repeat] lg:h-6 lg:w-6" |
| 137 | + style="--url: url(./twitter.svg)" |
| 138 | + href="https://twitter.com/devplayer55221" |
| 139 | + target="_blank" |
| 140 | + rel="me" |
| 141 | + >twitter</a> |
| 142 | + <a |
| 143 | + class="h-7 w-7 text-[0px] [background:var(--url)_center_center/cover_no-repeat] lg:h-6 lg:w-6" |
| 144 | + style="--url: url(./github.svg)" |
| 145 | + href="https://github.com/devplayer55221" |
| 146 | + target="_blank" |
| 147 | + rel="me" |
| 148 | + >github</a> |
| 149 | + <a |
| 150 | + class="h-7 w-7 text-[0px] [background:var(--url)_center_center/cover_no-repeat] lg:h-6 lg:w-6" |
| 151 | + style="--url: url(./linkedin.svg)" |
| 152 | + href="https://linkedin.com/in/mukund-kr-kedia" |
| 153 | + target="_blank" |
| 154 | + rel="me" |
| 155 | + >linkedin</a> |
| 156 | + </nav> |
| 157 | + </div> |
| 158 | +</header> |
| 159 | +<main |
| 160 | + class="prose prose-neutral dark:prose-invert relative mx-auto min-h-[calc(100vh-9rem)] max-w-(--w) px-8 pt-14 pb-16" |
| 161 | + ><article> |
| 162 | + <header class="mb-14"> |
| 163 | + <h1 class="my-0! pb-2.5">Coding in C++</h1><div class="text-xs antialiased opacity-60"><time>May 12, 2025</time><span class="mx-1">·</span> |
| 164 | + <span>mukund</span></div></header> |
| 165 | + |
| 166 | + <section><pre tabindex="0"><code>#pragma once |
| 167 | +</code></pre><p>This code prevents the header file from loading multiple times in a single .cpp file.</p> |
| 168 | +<pre tabindex="0"><code>#ifndef _LOG_H |
| 169 | +</code></pre><p>This code means ’execute below statements if _LOG_H is not defined'.</p> |
| 170 | +</section> |
| 171 | + |
| 172 | + <footer class="mt-12 flex flex-wrap"><a |
| 173 | + class="mb-1.5 rounded-lg bg-black/[3%] px-5 py-1 no-underline hover:bg-black/[6%] ltr:mr-1.5 rtl:ml-1.5 dark:bg-white/[8%] dark:hover:bg-white/[12%]" |
| 174 | + href="http://localhost:1313/tags/c++" |
| 175 | + >c++</a |
| 176 | + ></footer><nav |
| 177 | + 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%]" |
| 178 | + ><a |
| 179 | + class="justify-end pl-3 ltr:ml-auto rtl:mr-auto" |
| 180 | + href="http://localhost:1313/post/cplusplus-working/" |
| 181 | + ><span>C++ Working</span><span class="ltr:ml-1.5 rtl:mr-1.5">→</span></a |
| 182 | + ></nav></article></main><footer |
| 183 | + class="mx-auto flex h-[4.5rem] max-w-(--w) items-center px-8 text-xs tracking-wider uppercase opacity-60" |
| 184 | +> |
| 185 | + <div class="mr-auto">©2025 |
| 186 | + <a class="link" href="http://localhost:1313/">devplayer55221</a></div> |
| 187 | + <a class="link mx-6" href="https://gohugo.io/" rel="noopener" target="_blank" |
| 188 | + >powered by hugo️️</a |
| 189 | + >️ |
| 190 | + <a |
| 191 | + class="link" |
| 192 | + href="https://github.com/nanxiaobei/hugo-paper" |
| 193 | + rel="noopener" |
| 194 | + target="_blank" |
| 195 | + >hugo-paper</a |
| 196 | + > |
| 197 | +</footer> |
| 198 | +</body> |
| 199 | +</html> |
0 commit comments