Posts

Showing posts with the label cplusplus

C++ Prog Lang In A Nutshell VOL #2 Compiled By Bilal Ahmad Khan AKA Mr. BILRED - TechAmbitonX

Image
C++ Notes VOL #2 Released | TechAmbitionX C++ Prog Lang In A Nutshell VOL #2 Compiled by Mr. BILRED (aka Bilal Ahmad Khan) Alhamdulillah! The second volume of my C++ notes is finally released Alhamdulillah After late-night edits and exam pressure (maybe), I’ve put together another handout. Actually, it's my midterm right now... and I thought — why not compile VOL #2? What’s Inside? Functions, UDFs, Pass-by-Value / Reference Searching & Sorting (Linear, Binary, Bubble, Merge etc.) Cheatsheets for quick revision Final thoughts and insights It’s a sidekick, not the entire combo meal. But if you're someone who values conceptual clarity over technical jargon , this might just help you out! 📥 Visit GitHub 📥 Drive Download

What Are Vectors in C++? | TechAmbitionX - Bilal Ahmad Khan AKA Mr. BILRED

Image
What Are Vectors in C++? | TechAmbitionX 🔷 What Are Vectors in C++? Posted on TechAmbitionX by Mr. BILRED ✅ Definition: A vector in C++ is a dynamic array from the Standard Template Library (STL). Unlike normal arrays, vectors can grow and shrink in size during runtime. #include <vector> std::vector<datatype> name; 🚀 Why Use Vectors? Dynamic resizing ✅ Easy to use ✅ Built-in functions ✅ Safe access with .at() It works just like [ ], but with built-in bounds checking. ✅ 🔧 Common Methods: Method Description push_back(x) Adds element x to the end pop_back() Removes the last element size() Returns the number of elements empty() Checks if vector is empty clear() Removes all elements at(index) Safe access to element at index begin(), end() Used for iterating 🧠 How It Works Internally: Vectors store elements in a dynamic array. When they run out of space, they automatically: Create a new, larger arr...

1D & 2D Arrays in C++ ProgLang - Bilal Ahmad Khan AKA Mr. BILRED - TechAmbitionX

Image
1D & 2D Arrays - TechAmbitionX Understanding 1D and 2D Arrays Arrays are like containers that hold multiple values. Dusray alfaaz mein, An array is similar to a variable, but instead of storing a single value, it holds multiple values of the same type. These values are stored in consecutive memory locations. Let's dive into 1D and 2D arrays ! 1D Arrays A 1D (one-dimensional) array is like a simple list of values stored in memory. Example: // 📂 This File can also be accessed through: https://github.com/BilalAhmadKhanKhattak/CppNotes/blob/main/Arrays/1dArray.cpp // find the max in 1D array..... o bhai sab! #include using namespace std; int main() { int arr[5] = {23,4,12,6,64}; // This is what we call 1D array int maxNum = arr[0]; // for now, I'm gonna set it to 23 (just for now) watch and learn // I'll use loop to find the max in the array. Loops through the a...