diff --git a/src/data/roadmaps/c/content/_atomic@uDFazTncdICtqZyGIv3iZ.md b/src/data/roadmaps/c/content/_atomic@uDFazTncdICtqZyGIv3iZ.md index 37f3c920e..7676abf2c 100644 --- a/src/data/roadmaps/c/content/_atomic@uDFazTncdICtqZyGIv3iZ.md +++ b/src/data/roadmaps/c/content/_atomic@uDFazTncdICtqZyGIv3iZ.md @@ -1,3 +1,9 @@ # _Atomic - -The `_Atomic` qualifier, introduced in C11, marks a variable so that reads and writes to it happen as a single, indivisible operation, even when accessed from multiple threads. This prevents data races on that variable without needing a separate lock. It is used together with the `` header when writing concurrent C code. \ No newline at end of file + +The `_Atomic` qualifier, introduced in C11, marks a variable so that reads and writes to it happen as a single, indivisible operation, even when accessed from multiple threads. This prevents data races on that variable without needing a separate lock. It is used together with the `` header when writing concurrent C code. + +Visit the following resources to learn more: + +- [@article@Atomic types](https://en.cppreference.com/c/language/atomic) +- [@article@What is the _Atomic keyword in C?](https://www.educative.io/answers/what-is-the-atomic-keyword-in-c) +- [@article@Understanding _Atomic Types in C](https://andrewjohnson4.substack.com/p/understanding-_atomic-types-in-c) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/abi@YclFmrSZ3LcNxnXHU5zl-.md b/src/data/roadmaps/c/content/abi@YclFmrSZ3LcNxnXHU5zl-.md index 20575072e..b360f43ab 100644 --- a/src/data/roadmaps/c/content/abi@YclFmrSZ3LcNxnXHU5zl-.md +++ b/src/data/roadmaps/c/content/abi@YclFmrSZ3LcNxnXHU5zl-.md @@ -1,3 +1,9 @@ # ABI - -An ABI (Application Binary Interface) defines the low-level conventions that compiled code must follow to be compatible with other compiled code, including how function arguments are passed, how data is laid out in memory, and how the stack is organized. Unlike a language-level API, which concerns source code compatibility, an ABI concerns binary compatibility between already-compiled pieces of code. Two libraries compiled with incompatible ABIs, for example using different compilers or settings, may not work correctly together even if their source-level interfaces match. \ No newline at end of file + +An ABI (Application Binary Interface) defines the low-level conventions that compiled code must follow to be compatible with other compiled code, including how function arguments are passed, how data is laid out in memory, and how the stack is organized. Unlike a language-level API, which concerns source code compatibility, an ABI concerns binary compatibility between already-compiled pieces of code. Two libraries compiled with incompatible ABIs, for example using different compilers or settings, may not work correctly together even if their source-level interfaces match. + +Visit the following resources to learn more: + +- [@opensource@📌 Comprehensive Guide to the Application Binary Interface (ABI) in C and C++](https://gist.github.com/MangaD/506a0f3273724ef3af26b8c085accdcb) +- [@article@Application Binary Interfaces](https://developer.arm.com/documentation/den0013/0400/Application-Binary-Interfaces) +- [@video@What Is an ABI, and Why Should You Care?](https://www.youtube.com/watch?v=90fwlfon3Hk) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/applications@0jSjJfj-xvSsrmjrKscuq.md b/src/data/roadmaps/c/content/applications@0jSjJfj-xvSsrmjrKscuq.md index c02499b49..a6eaa8b80 100644 --- a/src/data/roadmaps/c/content/applications@0jSjJfj-xvSsrmjrKscuq.md +++ b/src/data/roadmaps/c/content/applications@0jSjJfj-xvSsrmjrKscuq.md @@ -1,3 +1,8 @@ # Applications - -C shows up in operating system kernels (Linux, Windows internals), embedded systems and microcontrollers, device drivers, database engines, and performance-critical libraries. Many other languages, including Python and Ruby, have interpreters written in C, and most language runtimes expose a C interface for interoperability. It is also the language of choice when a program needs to run close to hardware with minimal overhead. \ No newline at end of file + +C shows up in operating system kernels (Linux, Windows internals), embedded systems and microcontrollers, device drivers, database engines, and performance-critical libraries. Many other languages, including Python and Ruby, have interpreters written in C, and most language runtimes expose a C interface for interoperability. It is also the language of choice when a program needs to run close to hardware with minimal overhead. + +Visit the following resources to learn more: + +- [@article@Applications of C Programming That Will Make You Fall In Love With C](https://data-flair.training/blogs/applications-of-c/) +- [@article@What are common uses of C in the real world outside of embedded and OS dev?](https://www.reddit.com/r/C_Programming/comments/llwg2e/what_are_common_uses_of_c_in_the_real_world/) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/arithmetic@TqVZuxNp423auXIPmolrX.md b/src/data/roadmaps/c/content/arithmetic@TqVZuxNp423auXIPmolrX.md index 3ea0c7b96..64b4a7ce9 100644 --- a/src/data/roadmaps/c/content/arithmetic@TqVZuxNp423auXIPmolrX.md +++ b/src/data/roadmaps/c/content/arithmetic@TqVZuxNp423auXIPmolrX.md @@ -1,3 +1,7 @@ # Arithmetic - -Arithmetic operators perform basic mathematical operations: `+` for addition, `-` for subtraction, `*` for multiplication, `/` for division, and `%` for remainder (modulo). Division between two integers truncates toward zero and discards any fractional part, which can surprise programmers expecting a decimal result. Operator precedence follows standard mathematical rules, with multiplication and division evaluated before addition and subtraction unless parentheses override it. \ No newline at end of file + +Arithmetic operators perform basic mathematical operations: `+` for addition, `-` for subtraction, `*` for multiplication, `/` for division, and `%` for remainder (modulo). Division between two integers truncates toward zero and discards any fractional part, which can surprise programmers expecting a decimal result. Operator precedence follows standard mathematical rules, with multiplication and division evaluated before addition and subtraction unless parentheses override it. + +Visit the following resources to learn more: + +- [@article@C Arithmetic Operators](https://www.w3schools.com/c/c_operators_arithmetic.php) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/arrays@ZKpnuEvqZFm4cyzF43jSb.md b/src/data/roadmaps/c/content/arrays@ZKpnuEvqZFm4cyzF43jSb.md index 62f891b6a..baca2c52d 100644 --- a/src/data/roadmaps/c/content/arrays@ZKpnuEvqZFm4cyzF43jSb.md +++ b/src/data/roadmaps/c/content/arrays@ZKpnuEvqZFm4cyzF43jSb.md @@ -1,3 +1,9 @@ # Arrays - -An array in C is a fixed-size, contiguous block of memory holding multiple elements of the same type, accessed using an index starting at zero. The size of an array must be known at compile time unless it is allocated dynamically on the heap. Arrays decay into pointers to their first element when passed to functions, which means the function receiving them loses information about the array's original size. \ No newline at end of file + +An array in C is a fixed-size, contiguous block of memory holding multiple elements of the same type, accessed using an index starting at zero. The size of an array must be known at compile time unless it is allocated dynamically on the heap. Arrays decay into pointers to their first element when passed to functions, which means the function receiving them loses information about the array's original size. + +Visit the following resources to learn more: + +- [@article@C Arrays](https://www.w3schools.com/c/c_arrays.php) +- [@article@C Arrays](https://www.programiz.com/c-programming/c-arrays) +- [@video@Arrays in C are easy! 🗃️](https://www.youtube.com/watch?v=6Hk2aE_SRzY) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/asan--lsan@SOpS0quLuuiL0NlGPMtJg.md b/src/data/roadmaps/c/content/asan--lsan@SOpS0quLuuiL0NlGPMtJg.md index 208ebcf97..73dbe3b52 100644 --- a/src/data/roadmaps/c/content/asan--lsan@SOpS0quLuuiL0NlGPMtJg.md +++ b/src/data/roadmaps/c/content/asan--lsan@SOpS0quLuuiL0NlGPMtJg.md @@ -1,3 +1,9 @@ # ASan & LSan - -AddressSanitizer (ASan) and LeakSanitizer (LSan) are compiler-integrated tools, enabled with a flag like `-fsanitize=address`, that detect memory errors and leaks respectively by instrumenting the compiled code to check memory accesses at runtime. ASan catches issues such as buffer overflows, use-after-free, and use of memory after it goes out of scope, reporting the exact location of the error. Compared to tools like Valgrind, sanitizers typically run faster since the checks are built into the compiled binary itself rather than emulated externally. \ No newline at end of file + +AddressSanitizer (ASan) and LeakSanitizer (LSan) are compiler-integrated tools, enabled with a flag like `-fsanitize=address`, that detect memory errors and leaks respectively by instrumenting the compiled code to check memory accesses at runtime. ASan catches issues such as buffer overflows, use-after-free, and use of memory after it goes out of scope, reporting the exact location of the error. Compared to tools like Valgrind, sanitizers typically run faster since the checks are built into the compiled binary itself rather than emulated externally. + +Visit the following resources to learn more: + +- [@article@AddressSanitizer](https://learn.microsoft.com/en-gb/cpp/sanitizers/asan?view=msvc-170) +- [@video@find memory errors quickly. (-fsanitize, addresssanitizer)](https://www.youtube.com/watch?v=tEbV21aPSKw) +- [@video@Detect C++ Memory Leaks with ALSan:](https://www.youtube.com/watch?v=9f5hd-8suVE) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/asserth@oGePVWBoGQyGvNOqbW7qs.md b/src/data/roadmaps/c/content/asserth@oGePVWBoGQyGvNOqbW7qs.md index c28af6793..d663a084a 100644 --- a/src/data/roadmaps/c/content/asserth@oGePVWBoGQyGvNOqbW7qs.md +++ b/src/data/roadmaps/c/content/asserth@oGePVWBoGQyGvNOqbW7qs.md @@ -1,3 +1,9 @@ # assert.h - -`` provides the `assert` macro, which checks that a given condition is true and, if not, prints an error message with the file and line number before terminating the program. It is commonly used during development to catch programming errors early, such as invalid function arguments, rather than letting them cause harder-to-diagnose failures later. Defining the `NDEBUG` macro before including `` disables all assertions, which is typically done in release builds for performance. \ No newline at end of file + +`` provides the `assert` macro, which checks that a given condition is true and, if not, prints an error message with the file and line number before terminating the program. It is commonly used during development to catch programming errors early, such as invalid function arguments, rather than letting them cause harder-to-diagnose failures later. Defining the `NDEBUG` macro before including `` disables all assertions, which is typically done in release builds for performance. + +Visit the following resources to learn more: + +- [@article@C Library - \](https://www.tutorialspoint.com/c_standard_library/assert_h.htm) +- [@article@How to use assertions in C](https://ptolemy.berkeley.edu/~johnr/tutorials/assertions.html) +- [@video@Find bugs faster using assertions.](https://www.youtube.com/watch?v=1Jh9BUxIw0U) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/binary-vs-text-mode@qxz-_BtYBnX8cz2VLAgUN.md b/src/data/roadmaps/c/content/binary-vs-text-mode@qxz-_BtYBnX8cz2VLAgUN.md index 961743c2a..e90f473ec 100644 --- a/src/data/roadmaps/c/content/binary-vs-text-mode@qxz-_BtYBnX8cz2VLAgUN.md +++ b/src/data/roadmaps/c/content/binary-vs-text-mode@qxz-_BtYBnX8cz2VLAgUN.md @@ -1,3 +1,8 @@ # Binary vs Text Mode - -Text mode may translate certain characters, most notably line endings, when reading or writing a file, converting between the operating system's native line-ending convention and a consistent internal representation. Binary mode performs no such translation, transferring bytes exactly as they are stored. On Unix-like systems the two modes behave identically, but on Windows the distinction matters, since text mode translates between `\n` and `\r\n`. \ No newline at end of file + +Text mode may translate certain characters, most notably line endings, when reading or writing a file, converting between the operating system's native line-ending convention and a consistent internal representation. Binary mode performs no such translation, transferring bytes exactly as they are stored. On Unix-like systems the two modes behave identically, but on Windows the distinction matters, since text mode translates between `\n` and `\r\n`. + +Visit the following resources to learn more: + +- [@article@C File Handling](https://www.programiz.com/c-programming/c-file-input-output) +- [@video@Binary File Access Introduction | C Programming Example](https://www.youtube.com/watch?v=UtckqNKZFrA) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/bitwise@cj4suITy4GRvo8cmiSb5S.md b/src/data/roadmaps/c/content/bitwise@cj4suITy4GRvo8cmiSb5S.md index df4ec7cf9..383a8a0d7 100644 --- a/src/data/roadmaps/c/content/bitwise@cj4suITy4GRvo8cmiSb5S.md +++ b/src/data/roadmaps/c/content/bitwise@cj4suITy4GRvo8cmiSb5S.md @@ -1,3 +1,8 @@ # Bitwise - -Bitwise operators manipulate individual bits within a value, including AND (`&`), OR (`|`), XOR (`^`), NOT (`~`), and the shift operators (`<<`, `>>`). They are used in low-level programming for tasks like setting flags, masking bits, or optimizing certain calculations. Because they operate at the bit level, mixing them up with logical operators, like `&` versus `&&`, is a common source of bugs. \ No newline at end of file + +Bitwise operators manipulate individual bits within a value, including AND (`&`), OR (`|`), XOR (`^`), NOT (`~`), and the shift operators (`<<`, `>>`). They are used in low-level programming for tasks like setting flags, masking bits, or optimizing certain calculations. Because they operate at the bit level, mixing them up with logical operators, like `&` versus `&&`, is a common source of bugs. + +Visit the following resources to learn more: + +- [@article@Bitwise operators](https://www.tutorialspoint.com/cprogramming/c_bitwise_operators.htm) +- [@video@C bitwise operators 🔣](https://www.youtube.com/watch?v=BGeOwlIGRGI) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/booleans@Ut8jRmxC2SLELJd4oEgwQ.md b/src/data/roadmaps/c/content/booleans@Ut8jRmxC2SLELJd4oEgwQ.md index d5e9468ab..c4d979ff6 100644 --- a/src/data/roadmaps/c/content/booleans@Ut8jRmxC2SLELJd4oEgwQ.md +++ b/src/data/roadmaps/c/content/booleans@Ut8jRmxC2SLELJd4oEgwQ.md @@ -1,3 +1,8 @@ # booleans - -C did not originally have a dedicated boolean type, relying instead on the convention that zero means false and any nonzero value means true. Since C99, the `` header provides a `bool` type along with `true` and `false` macros for clearer code. Under the hood, `bool` is still typically implemented as a small integer type. \ No newline at end of file + +C did not originally have a dedicated boolean type, relying instead on the convention that zero means false and any nonzero value means true. Since C99, the `` header provides a `bool` type along with `true` and `false` macros for clearer code. Under the hood, `bool` is still typically implemented as a small integer type. + +Visit the following resources to learn more: + +- [@article@C Booleans](https://www.w3schools.com/c/c_booleans.php) +- [@video@Boolean and Comparison Operators in C Programming](https://www.youtube.com/watch?v=TybmJxXRV80) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/break--continue@PB9wjYwkQI-ydITRr4nHD.md b/src/data/roadmaps/c/content/break--continue@PB9wjYwkQI-ydITRr4nHD.md index e2b6fa5e4..cc6890616 100644 --- a/src/data/roadmaps/c/content/break--continue@PB9wjYwkQI-ydITRr4nHD.md +++ b/src/data/roadmaps/c/content/break--continue@PB9wjYwkQI-ydITRr4nHD.md @@ -1,3 +1,9 @@ # break / continue - -`break` immediately exits the nearest enclosing loop or `switch` statement, skipping any remaining iterations or cases. `continue` skips the rest of the current loop iteration and jumps straight to the next one, without exiting the loop entirely. Both give finer control over loop execution beyond what the loop's own condition provides. \ No newline at end of file + +`break` immediately exits the nearest enclosing loop or `switch` statement, skipping any remaining iterations or cases. `continue` skips the rest of the current loop iteration and jumps straight to the next one, without exiting the loop entirely. Both give finer control over loop execution beyond what the loop's own condition provides. + +Visit the following resources to learn more: + +- [@article@Break Statement in C](https://www.tutorialspoint.com/cprogramming/c_break_statement.htm) +- [@article@Continue Statement in C](https://www.tutorialspoint.com/cprogramming/c_continue_statement.htm) +- [@video@C break vs continue 🥊](https://www.youtube.com/watch?v=N1twTeNMdOE) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/buffer-overflow@1KoVKffvv8bhaoq6LHqUC.md b/src/data/roadmaps/c/content/buffer-overflow@1KoVKffvv8bhaoq6LHqUC.md index a8616bcd9..765bcfa34 100644 --- a/src/data/roadmaps/c/content/buffer-overflow@1KoVKffvv8bhaoq6LHqUC.md +++ b/src/data/roadmaps/c/content/buffer-overflow@1KoVKffvv8bhaoq6LHqUC.md @@ -1,3 +1,9 @@ # Buffer Overflow - -A buffer overflow occurs when a program writes more data into a fixed-size buffer, like an array, than it can hold, overwriting adjacent memory. This can corrupt other variables, crash the program, or in more severe cases be exploited to execute malicious code, making it a well-known security vulnerability. Using safer alternatives to functions like `strcpy`, such as `strncpy` or `snprintf` with explicit size limits, helps prevent it. \ No newline at end of file + +A buffer overflow occurs when a program writes more data into a fixed-size buffer, like an array, than it can hold, overwriting adjacent memory. This can corrupt other variables, crash the program, or in more severe cases be exploited to execute malicious code, making it a well-known security vulnerability. Using safer alternatives to functions like `strcpy`, such as `strncpy` or `snprintf` with explicit size limits, helps prevent it. + +Visit the following resources to learn more: + +- [@article@Buffer Overflow Exploit in C. A brief overview with a hands on lab.](https://medium.com/@brendamejia/buffer-overflow-exploit-in-c-a-brief-overview-with-a-hands-on-lab-60e53d0d8d08) +- [@video@C Buffer Overflow, Heap/Stack Corruption and Analysis](https://www.youtube.com/watch?v=CQ6pGrXY1Us) +- [@video@Running a Buffer Overflow Attack](https://www.youtube.com/watch?v=1S0aBV-Waeo) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/build--compilation@ncyN2q1gmZcqCiTLJu9hn.md b/src/data/roadmaps/c/content/build--compilation@ncyN2q1gmZcqCiTLJu9hn.md index 29b063058..1bc87485f 100644 --- a/src/data/roadmaps/c/content/build--compilation@ncyN2q1gmZcqCiTLJu9hn.md +++ b/src/data/roadmaps/c/content/build--compilation@ncyN2q1gmZcqCiTLJu9hn.md @@ -1,3 +1,3 @@ # Build & Compilation - + Building and compiling a C program is the process of transforming human-readable source code into an executable binary, passing through stages including preprocessing, compilation, assembly, and linking. Understanding this pipeline helps explain common errors, like the difference between a compiler error, which happens when code is invalid, and a linker error, which happens when a function or variable cannot be found. Build tools automate this process, especially for projects with many source files. \ No newline at end of file diff --git a/src/data/roadmaps/c/content/build-systems@dhFsP1jJLVz7nsc5IfBrH.md b/src/data/roadmaps/c/content/build-systems@dhFsP1jJLVz7nsc5IfBrH.md index eff87146e..dd1195d8a 100644 --- a/src/data/roadmaps/c/content/build-systems@dhFsP1jJLVz7nsc5IfBrH.md +++ b/src/data/roadmaps/c/content/build-systems@dhFsP1jJLVz7nsc5IfBrH.md @@ -1,3 +1,3 @@ # Build Systems - + A build system automates the process of compiling and linking a project's source files into a final executable or library, tracking dependencies so that only files affected by a change need to be rebuilt. Options range from simple tools like GNU Make, which uses explicit rules in a Makefile, to higher-level generators like CMake, which produce build files for other underlying build tools. Choosing a build system matters more as a project grows beyond a handful of source files. \ No newline at end of file diff --git a/src/data/roadmaps/c/content/c-standards@2o1kK-ptkKNpCYZALmYTU.md b/src/data/roadmaps/c/content/c-standards@2o1kK-ptkKNpCYZALmYTU.md index 2de23d4bf..3adde846d 100644 --- a/src/data/roadmaps/c/content/c-standards@2o1kK-ptkKNpCYZALmYTU.md +++ b/src/data/roadmaps/c/content/c-standards@2o1kK-ptkKNpCYZALmYTU.md @@ -1,3 +1,8 @@ # C Standards - -C has evolved through a series of standardized versions published by ANSI and ISO, each adding new features and clarifying existing behavior while aiming to remain largely compatible with earlier code. Notable versions include C89/C90, the first widely adopted standard, C99, which added several commonly used features, C11, which introduced multithreading and atomics, and the more recent C17 and C23. Knowing which standard a codebase or compiler targets matters because some features, like `_Atomic` or fixed-width integers, are only guaranteed to exist from a specific version onward. \ No newline at end of file + +C has evolved through a series of standardized versions published by ANSI and ISO, each adding new features and clarifying existing behavior while aiming to remain largely compatible with earlier code. Notable versions include C89/C90, the first widely adopted standard, C99, which added several commonly used features, C11, which introduced multithreading and atomics, and the more recent C17 and C23. Knowing which standard a codebase or compiler targets matters because some features, like `_Atomic` or fixed-width integers, are only guaranteed to exist from a specific version onward. + +Visit the following resources to learn more: + +- [@article@C - Standards (ANSI, ISO, C99, C11, C17)](https://www.tutorialspoint.com/cprogramming/c_standards.htm) +- [@video@8) C language GUIDE: standards (K&R, ANSI, C99, C11, C17, C2x)](https://www.youtube.com/watch?v=etJzrUzk5Rc) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/c-vs-assembly@iJnBnTdwAgSTPBDPaqqqA.md b/src/data/roadmaps/c/content/c-vs-assembly@iJnBnTdwAgSTPBDPaqqqA.md index 7ef753d31..0d419187b 100644 --- a/src/data/roadmaps/c/content/c-vs-assembly@iJnBnTdwAgSTPBDPaqqqA.md +++ b/src/data/roadmaps/c/content/c-vs-assembly@iJnBnTdwAgSTPBDPaqqqA.md @@ -1,3 +1,8 @@ # C vs Assembly - -Assembly language maps almost directly to a specific CPU's instruction set, so code written for one processor architecture will not run on another without a rewrite. C sits one level above assembly: it compiles down to machine code but uses portable syntax that works across architectures with little or no change. Programmers get most of the performance benefits of assembly with far less code and much better readability. C is sometimes called "portable assembly" for this reason. \ No newline at end of file + +Assembly language maps almost directly to a specific CPU's instruction set, so code written for one processor architecture will not run on another without a rewrite. C sits one level above assembly: it compiles down to machine code but uses portable syntax that works across architectures with little or no change. Programmers get most of the performance benefits of assembly with far less code and much better readability. C is sometimes called "portable assembly" for this reason. + +Visit the following resources to learn more: + +- [@article@C versus Assembly](https://www.dspguide.com/ch28/5.htm#:~:text=Programs%20written%20in%20assembly%20can,almost%20always%20the%20first%20choice.) +- [@video@Comparing C to machine language](https://www.youtube.com/watch?v=yOyaJXpAYZQ) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/c-vs-c@GBJVZLGm5dfAfba_7eJ79.md b/src/data/roadmaps/c/content/c-vs-c@GBJVZLGm5dfAfba_7eJ79.md index 67bc28679..0430050b3 100644 --- a/src/data/roadmaps/c/content/c-vs-c@GBJVZLGm5dfAfba_7eJ79.md +++ b/src/data/roadmaps/c/content/c-vs-c@GBJVZLGm5dfAfba_7eJ79.md @@ -1,3 +1,10 @@ # C vs C++ - -C is a procedural language with manual memory management and no built-in support for classes, inheritance, or exceptions. C++ extends C with object-oriented features, templates, the standard template library, and stronger compile-time checks, while remaining mostly compatible with C syntax. Programs written in C tend to be smaller and more predictable in behavior, while C++ trades some of that simplicity for abstraction and reuse. Choosing between them usually depends on whether the project needs low-level control or higher-level abstractions. \ No newline at end of file + +C is a procedural language with manual memory management and no built-in support for classes, inheritance, or exceptions. C++ extends C with object-oriented features, templates, the standard template library, and stronger compile-time checks, while remaining mostly compatible with C syntax. Programs written in C tend to be smaller and more predictable in behavior, while C++ trades some of that simplicity for abstraction and reuse. Choosing between them usually depends on whether the project needs low-level control or higher-level abstractions. + +Visit the following resources to learn more: + +- [@roadmap@Visit the Dedicated C++ Roadmap](https://roadmap.sh/cpp) +- [@article@C++ vs. C: When (and when not) to use each language](https://roadmap.sh/cpp/vs-c) +- [@article@C vs C++](https://www.reddit.com/r/C_Programming/comments/34tes5/c_vs_c/) +- [@video@C vs C++ vs C#](https://www.youtube.com/watch?v=sNMtjs_wQiE) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/c11@ZX5viPXChcZavr8qk9pGu.md b/src/data/roadmaps/c/content/c11@ZX5viPXChcZavr8qk9pGu.md index d70529d55..cdddced14 100644 --- a/src/data/roadmaps/c/content/c11@ZX5viPXChcZavr8qk9pGu.md +++ b/src/data/roadmaps/c/content/c11@ZX5viPXChcZavr8qk9pGu.md @@ -1,3 +1,7 @@ # C11 - -C11, published in 2011, introduced support for multithreading through ``, atomic operations via `_Atomic` and ``, and improved Unicode support. It also added optional bounds-checking functions intended to reduce common security vulnerabilities, though these saw limited adoption across compilers. C11 was a significant step in bringing standardized concurrency support directly into the language. \ No newline at end of file + +C11, published in 2011, introduced support for multithreading through ``, atomic operations via `_Atomic` and ``, and improved Unicode support. It also added optional bounds-checking functions intended to reduce common security vulnerabilities, though these saw limited adoption across compilers. C11 was a significant step in bringing standardized concurrency support directly into the language. + +Visit the following resources to learn more: + +- [@article@C11 (C standard revision) - Wikipedia](https://en.wikipedia.org/wiki/C11_(C_standard_revision)) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/c17@lA_D58yQWIOuo4lI4tuGH.md b/src/data/roadmaps/c/content/c17@lA_D58yQWIOuo4lI4tuGH.md index ac0f7c115..c9133f57e 100644 --- a/src/data/roadmaps/c/content/c17@lA_D58yQWIOuo4lI4tuGH.md +++ b/src/data/roadmaps/c/content/c17@lA_D58yQWIOuo4lI4tuGH.md @@ -1,3 +1,7 @@ # C17 - -C17, published in 2018, is primarily a bug-fix and clarification release for C11, correcting defects and ambiguities in the standard's wording without introducing significant new language features. It is sometimes referred to as C18 due to its actual publication date. Compilers that support C11 typically support C17 with little additional work, since the practical differences between the two are minor. \ No newline at end of file + +C17, published in 2018, is primarily a bug-fix and clarification release for C11, correcting defects and ambiguities in the standard's wording without introducing significant new language features. It is sometimes referred to as C18 due to its actual publication date. Compilers that support C11 typically support C17 with little additional work, since the practical differences between the two are minor. + +Visit the following resources to learn more: + +- [@article@C17 (C standard revision) - Wikipedia](https://en.wikipedia.org/wiki/C17_(C_standard_revision)) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/c23@ap6BqMVNnikfmwyS0TCeS.md b/src/data/roadmaps/c/content/c23@ap6BqMVNnikfmwyS0TCeS.md index 3148df6f2..35f692f6a 100644 --- a/src/data/roadmaps/c/content/c23@ap6BqMVNnikfmwyS0TCeS.md +++ b/src/data/roadmaps/c/content/c23@ap6BqMVNnikfmwyS0TCeS.md @@ -1,3 +1,7 @@ # C23 - -C23 is the most recent major revision of the C standard, adding features such as improved type inference with `auto` in some contexts, new attributes, and additional standard library functions, while continuing to refine areas like Unicode support. Compiler support for C23 features varies and continues to roll out gradually across GCC, Clang, and other compilers. Projects prioritizing portability often wait until a feature reaches broad compiler support before adopting it. \ No newline at end of file + +C23 is the most recent major revision of the C standard, adding features such as improved type inference with `auto` in some contexts, new attributes, and additional standard library functions, while continuing to refine areas like Unicode support. Compiler support for C23 features varies and continues to roll out gradually across GCC, Clang, and other compilers. Projects prioritizing portability often wait until a feature reaches broad compiler support before adopting it. + +Visit the following resources to learn more: + +- [@article@C23 (C standard revision) - Wikipedia](https://en.wikipedia.org/wiki/C23_(C_standard_revision)) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/c89--c90@HL2hdpgQyxV4vK2xmF_zG.md b/src/data/roadmaps/c/content/c89--c90@HL2hdpgQyxV4vK2xmF_zG.md index fdcafffa9..7178a3138 100644 --- a/src/data/roadmaps/c/content/c89--c90@HL2hdpgQyxV4vK2xmF_zG.md +++ b/src/data/roadmaps/c/content/c89--c90@HL2hdpgQyxV4vK2xmF_zG.md @@ -1,3 +1,8 @@ # C89 / C90 - -C89, also called C90 after its later ISO ratification, was the first standardized version of C, published in 1989 by ANSI. It established the core language and standard library that later versions built on, and remains the baseline that many embedded and legacy systems still target for maximum portability. Some features considered standard today, like `//` single-line comments or declaring variables anywhere in a block, were not part of this original standard. \ No newline at end of file + +C89, also called C90 after its later ISO ratification, was the first standardized version of C, published in 1989 by ANSI. It established the core language and standard library that later versions built on, and remains the baseline that many embedded and legacy systems still target for maximum portability. Some features considered standard today, like `//` single-line comments or declaring variables anywhere in a block, were not part of this original standard. + +Visit the following resources to learn more: + +- [@article@ANSI C - Wikipedia](https://en.wikipedia.org/wiki/ANSI_C) +- [@article@Understanding the Standard](https://www.davros.org/c/understand.html) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/c99@jU7wd6qvOc3EOErL3zx7I.md b/src/data/roadmaps/c/content/c99@jU7wd6qvOc3EOErL3zx7I.md index c8c15a965..5f2a5e2ce 100644 --- a/src/data/roadmaps/c/content/c99@jU7wd6qvOc3EOErL3zx7I.md +++ b/src/data/roadmaps/c/content/c99@jU7wd6qvOc3EOErL3zx7I.md @@ -1,3 +1,8 @@ # C99 - -C99, published in 1999, added several widely used features to the language, including the `bool` type via ``, variable-length arrays, `//` single-line comments, and the ability to declare variables anywhere within a block rather than only at its start. It also introduced the `restrict` keyword and improved support for floating-point behavior. Many compilers support most of C99 even when a project does not explicitly target it. \ No newline at end of file + +C99, published in 1999, added several widely used features to the language, including the `bool` type via ``, variable-length arrays, `//` single-line comments, and the ability to declare variables anywhere within a block rather than only at its start. It also introduced the `restrict` keyword and improved support for floating-point behavior. Many compilers support most of C99 even when a project does not explicitly target it. + +Visit the following resources to learn more: + +- [@article@C99 - Wikipedia](https://en.wikipedia.org/wiki/C99) +- [@article@c99 - compile standard C programs](https://pubs.opengroup.org/onlinepubs/009604499/utilities/c99.html) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/calloc@HM1brkIQ483av1Mjs3bjz.md b/src/data/roadmaps/c/content/calloc@HM1brkIQ483av1Mjs3bjz.md new file mode 100644 index 000000000..6dd09fc3c --- /dev/null +++ b/src/data/roadmaps/c/content/calloc@HM1brkIQ483av1Mjs3bjz.md @@ -0,0 +1,9 @@ +# calloc + +`calloc` is a function used to allocate a specified number of blocks of memory, each of a set size, and initializes every byte in that memory to zero. It takes two arguments: the number of elements to allocate and the size of each element in bytes. If the allocation is successful, it returns a pointer to the first byte of the allocated space, or a null pointer if the system lacks sufficient memory. + +Visit the following resources to learn more: + +- [@article@C Allocate Memory](https://www.w3schools.com/c/c_memory_allocate.php) +- [@article@C stdlib calloc() Function](https://www.w3schools.com/c/ref_stdlib_calloc.php#:~:text=The%20calloc()%20function%20allocates,our%20C%20Memory%20Management%20tutorial.) +- [@video@Calloc in C is easy! 🧹](https://www.youtube.com/watch?v=l8DU9ZeT3o8) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/char@5QfhF3454XaX8OwQuVHtm.md b/src/data/roadmaps/c/content/char@5QfhF3454XaX8OwQuVHtm.md index c788d4c73..b9cbb79b1 100644 --- a/src/data/roadmaps/c/content/char@5QfhF3454XaX8OwQuVHtm.md +++ b/src/data/roadmaps/c/content/char@5QfhF3454XaX8OwQuVHtm.md @@ -1,3 +1,8 @@ # char - -The `char` type stores a single byte, most often used to represent a character encoded as its numeric value, such as ASCII. It can be signed or unsigned depending on the compiler and platform, which affects how negative values behave. Arrays of `char` are also the basis for how C represents strings. \ No newline at end of file + +The `char` type stores a single byte, most often used to represent a character encoded as its numeric value, such as ASCII. It can be signed or unsigned depending on the compiler and platform, which affects how negative values behave. Arrays of `char` are also the basis for how C represents strings. + +Visit the following resources to learn more: + +- [@article@Definition and Usage](https://www.w3schools.com/c/ref_keyword_char.php) +- [@video@Learn C Programming - Char Data Type and ASCII Characters](https://www.youtube.com/watch?v=7_jRj7Ce90s) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/check@Q5zOAY446IeU9HQnLCiyD.md b/src/data/roadmaps/c/content/check@Q5zOAY446IeU9HQnLCiyD.md index 64210f0dc..5bde46a2d 100644 --- a/src/data/roadmaps/c/content/check@Q5zOAY446IeU9HQnLCiyD.md +++ b/src/data/roadmaps/c/content/check@Q5zOAY446IeU9HQnLCiyD.md @@ -1,3 +1,8 @@ # Check - -Check is a unit testing framework for C that runs each test case in its own separate process, so a crash or memory error in one test does not stop the rest of the test suite from running. It provides assertion macros and supports organizing tests into suites, similar to other C testing frameworks. Its process-isolation approach makes it particularly resilient when testing code prone to crashes or segmentation faults. \ No newline at end of file + +Check is a unit testing framework for C that runs each test case in its own separate process, so a crash or memory error in one test does not stop the rest of the test suite from running. It provides assertion macros and supports organizing tests into suites, similar to other C testing frameworks. Its process-isolation approach makes it particularly resilient when testing code prone to crashes or segmentation faults. + +Visit the following resources to learn more: + +- [@official@Check](https://libcheck.github.io/check/) +- [@opensource@check](https://github.com/libcheck/check) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/cmake@pOG9NvouqPEFHlz3Ekmla.md b/src/data/roadmaps/c/content/cmake@pOG9NvouqPEFHlz3Ekmla.md index dcbf99e4b..9ad5a5141 100644 --- a/src/data/roadmaps/c/content/cmake@pOG9NvouqPEFHlz3Ekmla.md +++ b/src/data/roadmaps/c/content/cmake@pOG9NvouqPEFHlz3Ekmla.md @@ -1,3 +1,8 @@ # CMake - -CMake is a cross-platform build system generator that reads a project description, written in its own CMake language, and produces native build files for the target platform, such as Makefiles on Linux or Visual Studio project files on Windows. This lets a single project configuration work across multiple platforms and underlying build tools without maintaining separate build scripts for each. It has become a de facto standard for larger, cross-platform C and C++ projects. \ No newline at end of file + +CMake is a cross-platform build system generator that reads a project description, written in its own CMake language, and produces native build files for the target platform, such as Makefiles on Linux or Visual Studio project files on Windows. This lets a single project configuration work across multiple platforms and underlying build tools without maintaining separate build scripts for each. It has become a de facto standard for larger, cross-platform C and C++ projects. + +Visit the following resources to learn more: + +- [@official@CMake Tutorial](https://cmake.org/cmake/help/latest/guide/tutorial/index.html) +- [@article@CMake Tutorial for Absolute Beginners](https://www.youtube.com/watch?v=NGPo7mz1oa4) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/cmocka@9g7mnYz1TVj2gyMXovmck.md b/src/data/roadmaps/c/content/cmocka@9g7mnYz1TVj2gyMXovmck.md index 43de13b7e..9d5a7a020 100644 --- a/src/data/roadmaps/c/content/cmocka@9g7mnYz1TVj2gyMXovmck.md +++ b/src/data/roadmaps/c/content/cmocka@9g7mnYz1TVj2gyMXovmck.md @@ -1,3 +1,8 @@ # CMocka - -CMocka is a unit testing framework for C that includes support for mock objects, letting tests replace real function calls with controlled substitutes to isolate the code under test. It provides assertion macros for checking expected values and can run groups of test cases together while reporting pass/fail results. Its mocking support makes it well suited to testing code with external dependencies, like hardware interfaces or network calls. \ No newline at end of file + +CMocka is a unit testing framework for C that includes support for mock objects, letting tests replace real function calls with controlled substitutes to isolate the code under test. It provides assertion macros for checking expected values and can run groups of test cases together while reporting pass/fail results. Its mocking support makes it well suited to testing code with external dependencies, like hardware interfaces or network calls. + +Visit the following resources to learn more: + +- [@official@CMocka](https://cmocka.org/) +- [@article@Unit testing C code with CMocka](https://blog.microjoe.org/2017/unit-tests-c-cmocka-coverage-cmake.html) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/code-editors--ides@TUpINnV49c-ioTGw6KSHM.md b/src/data/roadmaps/c/content/code-editors--ides@TUpINnV49c-ioTGw6KSHM.md index 5cfb95af2..c106c4951 100644 --- a/src/data/roadmaps/c/content/code-editors--ides@TUpINnV49c-ioTGw6KSHM.md +++ b/src/data/roadmaps/c/content/code-editors--ides@TUpINnV49c-ioTGw6KSHM.md @@ -1,3 +1,7 @@ # Code Editors / IDEs - -C can be written in a plain text editor, a lightweight code editor, or a full IDE, and the choice affects how much tooling support you get for things like autocomplete, debugging, and build integration. Lightweight editors like vim or VSCode require some manual setup for compiling and debugging, while full IDEs bundle these features together. Beginners often start with something simple and add tooling as their projects grow more complex. \ No newline at end of file + +C can be written in a plain text editor, a lightweight code editor, or a full IDE, and the choice affects how much tooling support you get for things like autocomplete, debugging, and build integration. Lightweight editors like vim or VSCode require some manual setup for compiling and debugging, while full IDEs bundle these features together. Beginners often start with something simple and add tooling as their projects grow more complex. + +Visit the following resources to learn more: + +- [@article@what are some good, simple C IDEs for the modern day?](https://www.reddit.com/r/C_Programming/comments/1ai3chm/what_are_some_good_simple_c_ides_for_the_modern/) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/command-line-arguments@Ss_Ga6RY_gAriphVtJ0wV.md b/src/data/roadmaps/c/content/command-line-arguments@Ss_Ga6RY_gAriphVtJ0wV.md index 79f1b1c9d..c385af0ac 100644 --- a/src/data/roadmaps/c/content/command-line-arguments@Ss_Ga6RY_gAriphVtJ0wV.md +++ b/src/data/roadmaps/c/content/command-line-arguments@Ss_Ga6RY_gAriphVtJ0wV.md @@ -1,3 +1,8 @@ # Command-Line Arguments - -Command-line arguments let a program receive input when it starts, passed through `main`'s parameters: `argc`, the count of arguments, and `argv`, an array of strings containing the arguments themselves, with `argv[0]` typically being the program's own name. This is how command-line tools accept options and file paths without needing interactive input. Parsing `argv` manually or with a library like `getopt` is a common early step in building any command-line utility. \ No newline at end of file + +Command-line arguments let a program receive input when it starts, passed through `main`'s parameters: `argc`, the count of arguments, and `argv`, an array of strings containing the arguments themselves, with `argv[0]` typically being the program's own name. This is how command-line tools accept options and file paths without needing interactive input. Parsing `argv` manually or with a library like `getopt` is a common early step in building any command-line utility. + +Visit the following resources to learn more: + +- [@article@Command Line Arguments in C](https://www.tutorialspoint.com/cprogramming/c_command_line_arguments.htm) +- [@video@Command Line Arguments](https://www.youtube.com/watch?v=wa2AfzyOff0) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/common-data-structures@Iw6fn73v5n8Ru0zA-IJfP.md b/src/data/roadmaps/c/content/common-data-structures@Iw6fn73v5n8Ru0zA-IJfP.md new file mode 100644 index 000000000..7c92358d3 --- /dev/null +++ b/src/data/roadmaps/c/content/common-data-structures@Iw6fn73v5n8Ru0zA-IJfP.md @@ -0,0 +1,3 @@ +# Common Data Structures + +Beyond the built-in array, C programmers commonly build their own data structures using structs and pointers, since the language does not provide these as ready-made library types. Common examples include dynamic arrays that grow as needed, linked lists that store elements as a chain of nodes, hash maps for fast key-based lookup, and ring buffers for fixed-size queues. Implementing these from scratch is a common exercise for understanding how higher-level languages' built-in collections work internally. \ No newline at end of file diff --git a/src/data/roadmaps/c/content/comparison@KG8ElQw797YppJNK4WhN-.md b/src/data/roadmaps/c/content/comparison@KG8ElQw797YppJNK4WhN-.md index 4721fa5df..83cb406c2 100644 --- a/src/data/roadmaps/c/content/comparison@KG8ElQw797YppJNK4WhN-.md +++ b/src/data/roadmaps/c/content/comparison@KG8ElQw797YppJNK4WhN-.md @@ -1,3 +1,8 @@ # Comparison - -Comparison operators, such as `==`, `!=`, `<`, `>`, `<=`, and `>=`, evaluate two values and produce a result of 1 (true) or 0 (false). They are commonly used in conditions for `if` statements and loops to control program flow. A frequent beginner mistake is writing `=` instead of `==`, which assigns a value instead of comparing it. \ No newline at end of file + +Comparison operators, such as `==`, `!=`, `<`, `>`, `<=`, and `>=`, evaluate two values and produce a result of 1 (true) or 0 (false). They are commonly used in conditions for `if` statements and loops to control program flow. A frequent beginner mistake is writing `=` instead of `==`, which assigns a value instead of comparing it. + +Visit the following resources to learn more: + +- [@article@Comparison Opearators](https://www.tutorialspoint.com/cprogramming/c_relational_operators.htm) +- [@article@C Comparison Opearators](https://www.w3schools.com/c/c_operators_comparison.php) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/compilers@HsGe9q5YMHPM8MP8XgGq-.md b/src/data/roadmaps/c/content/compilers@HsGe9q5YMHPM8MP8XgGq-.md index 74d15566b..6ee391391 100644 --- a/src/data/roadmaps/c/content/compilers@HsGe9q5YMHPM8MP8XgGq-.md +++ b/src/data/roadmaps/c/content/compilers@HsGe9q5YMHPM8MP8XgGq-.md @@ -1,3 +1,9 @@ # Compilers - -A compiler translates C source code into machine code that can run directly on a specific processor and operating system. Popular choices include GCC and Clang, which support most platforms, and specialized compilers like TinyCC, designed for speed rather than optimization. Compilers also expose various flags controlling optimization level, warnings, and debugging information included in the output. \ No newline at end of file + +A compiler translates C source code into machine code that can run directly on a specific processor and operating system. Popular choices include GCC and Clang, which support most platforms, and specialized compilers like TinyCC, designed for speed rather than optimization. Compilers also expose various flags controlling optimization level, warnings, and debugging information included in the output. + +Visit the following resources to learn more: + +- [@article@What is a Compiler? Compilers in C Explained for Beginners](https://www.freecodecamp.org/news/what-is-a-compiler-in-c/) +- [@article@How Does C Compilation Work?](https://medium.com/@bdov_/what-happens-when-you-type-gcc-main-c-a4454564e96d) +- [@video@Why is C Compiler So Smart?](https://www.youtube.com/watch?v=juWM6saNCZk) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/conan@XM3WkMySETrqHKYp992je.md b/src/data/roadmaps/c/content/conan@XM3WkMySETrqHKYp992je.md index 6461ca30b..a77c8cf4e 100644 --- a/src/data/roadmaps/c/content/conan@XM3WkMySETrqHKYp992je.md +++ b/src/data/roadmaps/c/content/conan@XM3WkMySETrqHKYp992je.md @@ -1,3 +1,8 @@ # Conan - -Conan is a package manager for C and C++ that manages both source and prebuilt binary packages, with a focus on handling different build configurations, such as debug versus release, or different compilers. It integrates with build systems including CMake and Meson, and maintains a central repository of package recipes that describe how to build and consume each library. It is commonly used in larger, multi-platform C++ projects, though it also supports C. \ No newline at end of file + +Conan is a package manager for C and C++ that manages both source and prebuilt binary packages, with a focus on handling different build configurations, such as debug versus release, or different compilers. It integrates with build systems including CMake and Meson, and maintains a central repository of package recipes that describe how to build and consume each library. It is commonly used in larger, multi-platform C++ projects, though it also supports C. + +Visit the following resources to learn more: + +- [@official@Conan Tutorial](https://docs.conan.io/2/tutorial.html) +- [@video@Introduction to C/C++ Package Management with Conan](https://www.youtube.com/watch?v=xBLjXdyh3zs&list=PLY0Zjn5rFo4OTu5_-pErorGBm0_-UNgCV) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/concurrency@_MtErgneJKhjg8PD9sThs.md b/src/data/roadmaps/c/content/concurrency@_MtErgneJKhjg8PD9sThs.md index 636ff79b0..d142a06d9 100644 --- a/src/data/roadmaps/c/content/concurrency@_MtErgneJKhjg8PD9sThs.md +++ b/src/data/roadmaps/c/content/concurrency@_MtErgneJKhjg8PD9sThs.md @@ -1,3 +1,10 @@ # Concurrency - -Concurrency in C covers running multiple sequences of execution, such as threads or processes, at the same time or in an interleaved fashion. This includes using POSIX threads for shared-memory parallelism within a single process, mutexes to prevent multiple threads from corrupting shared data, and inter-process communication for separate processes that need to exchange data. Writing correct concurrent C code requires careful attention to shared state, since the language provides no automatic protection against data races. \ No newline at end of file + +Concurrency in C covers running multiple sequences of execution, such as threads or processes, at the same time or in an interleaved fashion. This includes using POSIX threads for shared-memory parallelism within a single process, mutexes to prevent multiple threads from corrupting shared data, and inter-process communication for separate processes that need to exchange data. Writing correct concurrent C code requires careful attention to shared state, since the language provides no automatic protection against data races. + +Visit the following resources to learn more: + +- [@book@Introduction to Concurrent Programming in C](https://storm-lang.org/progvis-book/book.pdf) +- [@article@Threads, Mutexes and Concurrent Programming in C](https://www.codequoi.com/en/threads-mutexes-and-concurrent-programming-in-c/) +- [@article@Concurrency in C](https://www.classes.cs.uchicago.edu/archive/2017/spring/12300-1/lab5.html) +- [@video@Introduction To Threads (pthreads) | C Programming Tutorial](https://www.youtube.com/watch?v=ldJ8WGZVXZk) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/conditional-compilation@noUypqHxipILMic-CgaHC.md b/src/data/roadmaps/c/content/conditional-compilation@noUypqHxipILMic-CgaHC.md index db0e3582b..b85be93ac 100644 --- a/src/data/roadmaps/c/content/conditional-compilation@noUypqHxipILMic-CgaHC.md +++ b/src/data/roadmaps/c/content/conditional-compilation@noUypqHxipILMic-CgaHC.md @@ -1,3 +1,9 @@ # Conditional Compilation - -Conditional compilation uses preprocessor directives like `#ifdef`, `#ifndef`, `#if`, and `#endif` to include or exclude blocks of code before the compiler processes them, based on whether certain macros are defined. It is commonly used for platform-specific code, enabling debug-only sections, or preventing a header file from being included multiple times through header guards. Because this happens during preprocessing, excluded code is never even seen by the compiler. \ No newline at end of file + +Conditional compilation uses preprocessor directives like `#ifdef`, `#ifndef`, `#if`, and `#endif` to include or exclude blocks of code before the compiler processes them, based on whether certain macros are defined. It is commonly used for platform-specific code, enabling debug-only sections, or preventing a header file from being included multiple times through header guards. Because this happens during preprocessing, excluded code is never even seen by the compiler. + +Visit the following resources to learn more: + +- [@article@Conditional compilation directives in C](https://fastbitlab.com/blog/microcontroller-embedded-c-programming-lecture-182-conditional-compilation-directives/) +- [@article@Conditional compilation - Wikipedia](https://en.wikipedia.org/wiki/Conditional_compilation) +- [@video@Conditional Compilation Directives](https://www.youtube.com/watch?v=rTNDAMyRpUs) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/const@a0KWMhzef64QvM8l0Cp1P.md b/src/data/roadmaps/c/content/const@a0KWMhzef64QvM8l0Cp1P.md index 26729edca..d23c5a3db 100644 --- a/src/data/roadmaps/c/content/const@a0KWMhzef64QvM8l0Cp1P.md +++ b/src/data/roadmaps/c/content/const@a0KWMhzef64QvM8l0Cp1P.md @@ -1,3 +1,8 @@ # const - -The `const` qualifier marks a variable as read-only after initialization, so any attempt to modify it later triggers a compile-time error. It is commonly used for function parameters that should not be changed by the function, and for values that are fixed for the program's lifetime, like configuration constants. Using `const` where possible helps the compiler catch accidental modifications and documents intent for other readers of the code. \ No newline at end of file + +The `const` qualifier marks a variable as read-only after initialization, so any attempt to modify it later triggers a compile-time error. It is commonly used for function parameters that should not be changed by the function, and for values that are fixed for the program's lifetime, like configuration constants. Using `const` where possible helps the compiler catch accidental modifications and documents intent for other readers of the code. + +Visit the following resources to learn more: + +- [@article@C Constants](https://www.w3schools.com/c/c_constants.php) +- [@video@Constants in C](https://www.youtube.com/watch?v=BVnNg20AuYU) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/control-flow@MsLtiJwb0DsHNBebN0GrH.md b/src/data/roadmaps/c/content/control-flow@MsLtiJwb0DsHNBebN0GrH.md index 7aab5f3ab..2e356157f 100644 --- a/src/data/roadmaps/c/content/control-flow@MsLtiJwb0DsHNBebN0GrH.md +++ b/src/data/roadmaps/c/content/control-flow@MsLtiJwb0DsHNBebN0GrH.md @@ -1,3 +1,9 @@ # Control Flow - -Control flow determines the order in which statements in a program execute, using constructs like conditionals and loops instead of running every line top to bottom unconditionally. C provides `if`/`else` and `switch` for branching, and `for`, `while`, and `do-while` for repetition. Mastering control flow is what allows a program to make decisions and repeat work based on data rather than following a single fixed path. \ No newline at end of file + +Control flow determines the order in which statements in a program execute, using constructs like conditionals and loops instead of running every line top to bottom unconditionally. C provides `if`/`else` and `switch` for branching, and `for`, `while`, and `do-while` for repetition. Mastering control flow is what allows a program to make decisions and repeat work based on data rather than following a single fixed path. + +Visit the following resources to learn more: + +- [@article@C - Decision Making & Control Statements](https://www.tutorialspoint.com/cprogramming/c_decision_making.htm) +- [@article@C - Loops](https://www.tutorialspoint.com/cprogramming/c_loops.htm) +- [@video@Conditionals & Loops in C](https://www.youtube.com/playlist?list=PLBlnK6fEyqRgZq4a-SMViZr-V8jlvCioJ) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/dangling-pointers@nMzRriI7nNECvHOofg5wb.md b/src/data/roadmaps/c/content/dangling-pointers@nMzRriI7nNECvHOofg5wb.md index 488da200d..8741787a5 100644 --- a/src/data/roadmaps/c/content/dangling-pointers@nMzRriI7nNECvHOofg5wb.md +++ b/src/data/roadmaps/c/content/dangling-pointers@nMzRriI7nNECvHOofg5wb.md @@ -1,3 +1,9 @@ # Dangling Pointers - -A dangling pointer points to memory that has already been freed or otherwise become invalid, but the pointer itself still holds the old address. Using a dangling pointer, whether reading or writing through it, results in undefined behavior and can corrupt unrelated data. Setting a pointer to `NULL` immediately after freeing it is a common way to reduce the risk of accidentally using it again. \ No newline at end of file + +A dangling pointer points to memory that has already been freed or otherwise become invalid, but the pointer itself still holds the old address. Using a dangling pointer, whether reading or writing through it, results in undefined behavior and can corrupt unrelated data. Setting a pointer to `NULL` immediately after freeing it is a common way to reduce the risk of accidentally using it again. + +Visit the following resources to learn more: + +- [@article@Dangling Pointers in C](https://www.tutorialspoint.com/cprogramming/c_dangling_pointers.htm) +- [@article@Dangling Pointer in C: Causes, Types, Fixes & Examples](https://www.boardinfinity.com/blog/dangling-pointer-in-c/) +- [@video@Understanding the Dangling Pointers](https://www.youtube.com/watch?v=qNgV7oAHElk) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/data-types@OkN6Kgp_rYIfd7qivswlO.md b/src/data/roadmaps/c/content/data-types@OkN6Kgp_rYIfd7qivswlO.md index f62904d5c..287502ea3 100644 --- a/src/data/roadmaps/c/content/data-types@OkN6Kgp_rYIfd7qivswlO.md +++ b/src/data/roadmaps/c/content/data-types@OkN6Kgp_rYIfd7qivswlO.md @@ -1,3 +1,9 @@ # Data Types - -A data type in C defines what kind of value a variable can hold and how much memory it occupies, such as an integer, a floating-point number, or a character. C provides a small set of basic types built into the language, along with qualifiers and extended types for more specific needs. Choosing the right type affects both correctness, since operations behave differently across types, and memory usage. \ No newline at end of file + +A data type in C defines what kind of value a variable can hold and how much memory it occupies, such as an integer, a floating-point number, or a character. C provides a small set of basic types built into the language, along with qualifiers and extended types for more specific needs. Choosing the right type affects both correctness, since operations behave differently across types, and memory usage. + +Visit the following resources to learn more: + +- [@article@C Data Types](https://www.w3schools.com/c/c_data_types.php) +- [@article@C - Data Types](https://www.tutorialspoint.com/cprogramming/c_data_types.htm) +- [@video@C data types 📊](https://www.youtube.com/watch?v=1eyf1-RU_eg) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/data-utilities@_W2NLBaInoPAi47R1a_7t.md b/src/data/roadmaps/c/content/data-utilities@_W2NLBaInoPAi47R1a_7t.md index c957a4447..b9e078aba 100644 --- a/src/data/roadmaps/c/content/data-utilities@_W2NLBaInoPAi47R1a_7t.md +++ b/src/data/roadmaps/c/content/data-utilities@_W2NLBaInoPAi47R1a_7t.md @@ -1,3 +1,8 @@ # Data Utilities - -Data utility functions, largely from ``, provide general-purpose operations such as memory allocation (`malloc`, `free`), converting strings to numbers (`atoi`, `strtol`), generating pseudo-random numbers (`rand`), and sorting or searching arrays (`qsort`, `bsearch`). They cover common tasks that come up across many kinds of programs regardless of domain. Because they are part of the standard library, they are available on any standards-compliant C implementation without extra installation. \ No newline at end of file + +Data utility functions, largely from ``, provide general-purpose operations such as memory allocation (`malloc`, `free`), converting strings to numbers (`atoi`, `strtol`), generating pseudo-random numbers (`rand`), and sorting or searching arrays (`qsort`, `bsearch`). They cover common tasks that come up across many kinds of programs regardless of domain. Because they are part of the standard library, they are available on any standards-compliant C implementation without extra installation. + +Visit the following resources to learn more: + +- [@article@C stdlib (stdlib.h) Library](https://www.w3schools.com/c/c_ref_stdlib.php) +- [@article@C Library - \](https://www.tutorialspoint.com/c_standard_library/stdlib_h.htm) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/debugging@3X44ONbF3KDretxS6ZQO3.md b/src/data/roadmaps/c/content/debugging@3X44ONbF3KDretxS6ZQO3.md index ff19bb427..c59d861ae 100644 --- a/src/data/roadmaps/c/content/debugging@3X44ONbF3KDretxS6ZQO3.md +++ b/src/data/roadmaps/c/content/debugging@3X44ONbF3KDretxS6ZQO3.md @@ -1,3 +1,9 @@ # Debugging - -Debugging in C involves finding and fixing defects in a program, often using dedicated tools since bugs like memory corruption or undefined behavior may not produce an obvious, immediate symptom. Debuggers like GDB and LLDB let a programmer pause execution, inspect variables, and step through code line by line. Other tools, like Valgrind and sanitizers, specialize in detecting specific classes of bugs such as memory errors. \ No newline at end of file + +Debugging in C involves finding and fixing defects in a program, often using dedicated tools since bugs like memory corruption or undefined behavior may not produce an obvious, immediate symptom. Debuggers like GDB and LLDB let a programmer pause execution, inspect variables, and step through code line by line. Other tools, like Valgrind and sanitizers, specialize in detecting specific classes of bugs such as memory errors. + +Visit the following resources to learn more: + +- [@article@C Debugging](https://www.w3schools.com/c/c_debugging.php) +- [@article@C/Debugging](https://www.cs.yale.edu/homes/aspnes/pinewiki/C(2f)Debugging.html) +- [@video@Debugging C Programs](https://www.youtube.com/watch?v=mfmXcbiRs0E&list=PL9IEJIKnBJjHGWPN_S9NS_Ky1-tC8ZrUI) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/declaration-vs-definition@z1GOLWQOK2TQotdjX9XI0.md b/src/data/roadmaps/c/content/declaration-vs-definition@z1GOLWQOK2TQotdjX9XI0.md index 6d12032fd..f9940d9b7 100644 --- a/src/data/roadmaps/c/content/declaration-vs-definition@z1GOLWQOK2TQotdjX9XI0.md +++ b/src/data/roadmaps/c/content/declaration-vs-definition@z1GOLWQOK2TQotdjX9XI0.md @@ -1,3 +1,9 @@ # Declaration vs Definition - -A declaration tells the compiler that a variable or function exists and states its type, without necessarily allocating memory or providing a function body. A definition actually allocates storage for a variable or provides the function's implementation. In C, `extern int x;` is a declaration, while `int x;` is a definition. This distinction matters most when code spans multiple files and needs to share variables or functions across them. \ No newline at end of file + +A declaration tells the compiler that a variable or function exists and states its type, without necessarily allocating memory or providing a function body. A definition actually allocates storage for a variable or provides the function's implementation. In C, `extern int x;` is a declaration, while `int x;` is a definition. This distinction matters most when code spans multiple files and needs to share variables or functions across them. + +Visit the following resources to learn more: + +- [@article@C - Variables](https://www.tutorialspoint.com/cprogramming/c_variables.htm) +- [@video@Declaration vs. Definition of a variable in C](https://www.youtube.com/watch?v=TtJw4VUYsiM) +- [@video@C variables 💰](https://www.youtube.com/watch?v=aIQk1O08zpg) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/diagnostics--limits@5aE4q0ZIm4_eWdcaBc2a8.md b/src/data/roadmaps/c/content/diagnostics--limits@5aE4q0ZIm4_eWdcaBc2a8.md index 2c2919fb4..2cadad711 100644 --- a/src/data/roadmaps/c/content/diagnostics--limits@5aE4q0ZIm4_eWdcaBc2a8.md +++ b/src/data/roadmaps/c/content/diagnostics--limits@5aE4q0ZIm4_eWdcaBc2a8.md @@ -1,3 +1,8 @@ # Diagnostics & Limits - -Diagnostic and limit headers, such as `` and ``, provide tools for catching bugs and understanding platform constraints. The `assert` macro checks that a condition holds true during development and aborts the program with a message if it does not, while `` defines constants like `INT_MAX` describing the range of values each integer type can hold on the current platform. These are used more during development and debugging than in a program's normal runtime logic. \ No newline at end of file + +Diagnostic and limit headers, such as `` and ``, provide tools for catching bugs and understanding platform constraints. The `assert` macro checks that a condition holds true during development and aborts the program with a message if it does not, while `` defines constants like `INT_MAX` describing the range of values each integer type can hold on the current platform. These are used more during development and debugging than in a program's normal runtime logic. + +Visit the following resources to learn more: + +- [@article@C Library - \](https://www.tutorialspoint.com/c_standard_library/limits_h.htm) +- [@article@C Library - \](https://www.tutorialspoint.com/c_standard_library/assert_h.htm) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/double@TBx0uWZ2T7RXLUC5EtU_j.md b/src/data/roadmaps/c/content/double@TBx0uWZ2T7RXLUC5EtU_j.md index 837eb12b8..6c4838a86 100644 --- a/src/data/roadmaps/c/content/double@TBx0uWZ2T7RXLUC5EtU_j.md +++ b/src/data/roadmaps/c/content/double@TBx0uWZ2T7RXLUC5EtU_j.md @@ -1,3 +1,8 @@ # double - -The `double` type stores double-precision floating-point numbers, offering roughly twice the precision of `float`, around 15 to 17 significant decimal digits, and typically occupying 8 bytes of memory. It is the default floating-point type used by C's standard library functions unless `float` is specified explicitly. `double` is generally preferred over `float` when precision matters more than memory savings. \ No newline at end of file + +The `double` type stores double-precision floating-point numbers, offering roughly twice the precision of `float`, around 15 to 17 significant decimal digits, and typically occupying 8 bytes of memory. It is the default floating-point type used by C's standard library functions unless `float` is specified explicitly. `double` is generally preferred over `float` when precision matters more than memory savings. + +Visit the following resources to learn more: + +- [@article@Double In C](https://www.upgrad.com/tutorials/software-engineering/c-tutorial/double-in-c/) +- [@video@Fundamental Data Types − Float, Double & Long Double](https://www.youtube.com/watch?v=vNeOx1rQ25E) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/dynamic-arrays@buxZzmsp2R4LenE1IxPjo.md b/src/data/roadmaps/c/content/dynamic-arrays@buxZzmsp2R4LenE1IxPjo.md index b0eebaa82..3fc064efd 100644 --- a/src/data/roadmaps/c/content/dynamic-arrays@buxZzmsp2R4LenE1IxPjo.md +++ b/src/data/roadmaps/c/content/dynamic-arrays@buxZzmsp2R4LenE1IxPjo.md @@ -1,3 +1,9 @@ # Dynamic Arrays - -A dynamic array is an array-like structure that can grow or shrink at runtime, typically implemented by allocating memory on the heap and reallocating a larger block, often using `realloc`, when it runs out of space. Unlike a fixed-size C array, it tracks both its current length and its allocated capacity separately. This pattern underlies dynamic array types like C++'s `std::vector` or Python's list, though C requires implementing it manually. \ No newline at end of file + +A dynamic array is an array-like structure that can grow or shrink at runtime, typically implemented by allocating memory on the heap and reallocating a larger block, often using `realloc`, when it runs out of space. Unlike a fixed-size C array, it tracks both its current length and its allocated capacity separately. This pattern underlies dynamic array types like C++'s `std::vector` or Python's list, though C requires implementing it manually. + +Visit the following resources to learn more: + +- [@article@Dynamic Arrays in C](https://www.bytesbeneath.com/p/dynamic-arrays-in-c?hide_intro_popup=true) +- [@article@Dynamic arrays in C: An implementation guide](https://medium.com/@sohaib.arshid101/dynamic-arrays-in-c-an-implementation-guide-4a959de94332) +- [@video@Dynamic Arrays in C](https://www.youtube.com/watch?v=_KSKH8C9Gf0) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/dynamic-memory-allocation@Fdf3p_5PW_MWr_b_DXRRU.md b/src/data/roadmaps/c/content/dynamic-memory-allocation@Fdf3p_5PW_MWr_b_DXRRU.md index 2b5c73c8c..158b760f0 100644 --- a/src/data/roadmaps/c/content/dynamic-memory-allocation@Fdf3p_5PW_MWr_b_DXRRU.md +++ b/src/data/roadmaps/c/content/dynamic-memory-allocation@Fdf3p_5PW_MWr_b_DXRRU.md @@ -1,3 +1,9 @@ # Dynamic Memory Allocation - -Dynamic memory allocation reserves memory on the heap at runtime, when the amount of memory needed is not known in advance or needs to outlive the function that created it. C provides `malloc`, `calloc`, and `realloc` for allocation and `free` for releasing memory back to the system. Every successful allocation must eventually be paired with exactly one `free` call, and using memory after freeing it or freeing it twice both lead to undefined behavior. \ No newline at end of file + +Dynamic memory allocation reserves memory on the heap at runtime, when the amount of memory needed is not known in advance or needs to outlive the function that created it. C provides `malloc`, `calloc`, and `realloc` for allocation and `free` for releasing memory back to the system. Every successful allocation must eventually be paired with exactly one `free` call, and using memory after freeing it or freeing it twice both lead to undefined behavior. + +Visit the following resources to learn more: + +- [@article@C Memory Management](https://www.w3schools.com/c/c_memory_management.php) +- [@article@C Programming — Dynamic Memory Allocation](https://medium.com/@acamvproducingstudio/c-programming-dynamic-memory-allocation-86221e811379) +- [@video@Dynamic Memory Allocation | C Programming Tutorial](https://www.youtube.com/watch?v=R0qIYWo8igs) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/enums@o6F1LPMXuGDt1LBa4TF3r.md b/src/data/roadmaps/c/content/enums@o6F1LPMXuGDt1LBa4TF3r.md index e48d4b8f1..d92b235db 100644 --- a/src/data/roadmaps/c/content/enums@o6F1LPMXuGDt1LBa4TF3r.md +++ b/src/data/roadmaps/c/content/enums@o6F1LPMXuGDt1LBa4TF3r.md @@ -1,3 +1,9 @@ # Enums - -An `enum` defines a type consisting of a set of named integer constants, making code more readable than using raw numbers to represent a fixed set of options, such as days of the week or states in a state machine. By default, enum values start at 0 and increase by one for each subsequent name, though explicit values can be assigned. Enums are just integers under the hood, so C does not prevent assigning an out-of-range integer to an enum variable. \ No newline at end of file + +An `enum` defines a type consisting of a set of named integer constants, making code more readable than using raw numbers to represent a fixed set of options, such as days of the week or states in a state machine. By default, enum values start at 0 and increase by one for each subsequent name, though explicit values can be assigned. Enums are just integers under the hood, so C does not prevent assigning an out-of-range integer to an enum variable. + +Visit the following resources to learn more: + +- [@article@C Enumeration (enum)](https://www.w3schools.com/c/c_enums.php) +- [@article@Enumerations](https://en.cppreference.com/c/language/enum) +- [@video@Learn enums in 8 minutes! 📅](https://www.youtube.com/watch?v=sU0XQ3jSsu8) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/errno@5luB8FgdkP_LvW2d0HYuZ.md b/src/data/roadmaps/c/content/errno@5luB8FgdkP_LvW2d0HYuZ.md index 09f9d55fa..cf85cf60c 100644 --- a/src/data/roadmaps/c/content/errno@5luB8FgdkP_LvW2d0HYuZ.md +++ b/src/data/roadmaps/c/content/errno@5luB8FgdkP_LvW2d0HYuZ.md @@ -1,3 +1,9 @@ # errno - -`errno` is a global variable, declared in ``, that many standard library functions set to a specific error code when they fail. It is not automatically reset to zero on success, so it should only be checked immediately after a function call that is documented to set it, and typically after confirming the function actually failed. Functions like `perror` or `strerror` translate an `errno` value into a human-readable message. \ No newline at end of file + +`errno` is a global variable, declared in ``, that many standard library functions set to a specific error code when they fail. It is not automatically reset to zero on success, so it should only be checked immediately after a function call that is documented to set it, and typically after confirming the function actually failed. Functions like `perror` or `strerror` translate an `errno` value into a human-readable message. + +Visit the following resources to learn more: + +- [@article@Errno and Error Management in C](https://www.codequoi.com/en/errno-and-error-management-in-c/) +- [@article@A Guide to Error Handling in C](https://psychocod3r.wordpress.com/2019/04/02/a-guide-to-error-handling-in-c/) +- [@video@Handling Errors in C/Unix (perror, strerror, errno)](https://www.youtube.com/watch?v=IZiUT-ipnj0) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/error-handling@IX-B5Dik_cpfi8zlaaVYH.md b/src/data/roadmaps/c/content/error-handling@IX-B5Dik_cpfi8zlaaVYH.md index 5c9d4616d..483929556 100644 --- a/src/data/roadmaps/c/content/error-handling@IX-B5Dik_cpfi8zlaaVYH.md +++ b/src/data/roadmaps/c/content/error-handling@IX-B5Dik_cpfi8zlaaVYH.md @@ -1,3 +1,9 @@ # Error Handling - -C has no built-in exception mechanism like some other languages, so error handling relies on conventions such as checking return values, setting the global `errno` variable, and in some cases using program termination through exit codes. This puts more responsibility on the programmer to consistently check for and respond to failure conditions. Non-local jumps with `setjmp`/`longjmp` provide a limited alternative for handling certain error scenarios that need to unwind multiple function calls at once. \ No newline at end of file + +C has no built-in exception mechanism like some other languages, so error handling relies on conventions such as checking return values, setting the global `errno` variable, and in some cases using program termination through exit codes. This puts more responsibility on the programmer to consistently check for and respond to failure conditions. Non-local jumps with `setjmp`/`longjmp` provide a limited alternative for handling certain error scenarios that need to unwind multiple function calls at once. + +Visit the following resources to learn more: + +- [@article@C Error Handling](https://www.w3schools.com/c/c_error_handling.php) +- [@article@The different ways to handle errors in C](https://mccue.dev/pages/7-27-22-c-errors) +- [@video@Error Handling | C Programming Tutorial](https://www.youtube.com/watch?v=OOuZLI5ingc) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/exit-codes@nk5RkhCSxdZL0RplXmp7-.md b/src/data/roadmaps/c/content/exit-codes@nk5RkhCSxdZL0RplXmp7-.md index aca0b4d0d..0b1c451a4 100644 --- a/src/data/roadmaps/c/content/exit-codes@nk5RkhCSxdZL0RplXmp7-.md +++ b/src/data/roadmaps/c/content/exit-codes@nk5RkhCSxdZL0RplXmp7-.md @@ -1,3 +1,9 @@ # Exit Codes - -An exit code is a small integer that a program returns to the operating system when it finishes, indicating whether it succeeded or failed, and if it failed, sometimes why. By convention, an exit code of 0 means success and any nonzero value indicates an error, with `EXIT_SUCCESS` and `EXIT_FAILURE` from `` providing portable constants for these. Exit codes are commonly checked by shell scripts and other programs that call a C program and need to know whether it completed successfully. \ No newline at end of file + +An exit code is a small integer that a program returns to the operating system when it finishes, indicating whether it succeeded or failed, and if it failed, sometimes why. By convention, an exit code of 0 means success and any nonzero value indicates an error, with `EXIT_SUCCESS` and `EXIT_FAILURE` from `` providing portable constants for these. Exit codes are commonly checked by shell scripts and other programs that call a C program and need to know whether it completed successfully. + +Visit the following resources to learn more: + +- [@article@Exit Codes in Linux C Programming](https://medium.com/@linuxrootroom/exit-codes-in-linux-c-programming-14dd90c4b48d) +- [@article@exit](https://en.cppreference.com/c/program/exit) +- [@video@Getting exit status code in C](https://www.youtube.com/watch?v=DiNmwwQWl0g) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/extended-types@yV8aU6aWcfH2TRZX4lymc.md b/src/data/roadmaps/c/content/extended-types@yV8aU6aWcfH2TRZX4lymc.md index 721cc9161..0a6b1b28e 100644 --- a/src/data/roadmaps/c/content/extended-types@yV8aU6aWcfH2TRZX4lymc.md +++ b/src/data/roadmaps/c/content/extended-types@yV8aU6aWcfH2TRZX4lymc.md @@ -1,3 +1,7 @@ # Extended Types - -Extended types cover additional numeric and specialized types beyond the basic set, such as `long long` for larger integer ranges, `long double` for extended floating-point precision, and complex number types added in later C standards. They exist to handle cases where the basic types are not large or precise enough. Availability and exact behavior of some extended types can vary between compilers and standards versions. \ No newline at end of file + +Extended types cover additional numeric and specialized types beyond the basic set, such as `long long` for larger integer ranges, `long double` for extended floating-point precision, and complex number types added in later C standards. They exist to handle cases where the basic types are not large or precise enough. Availability and exact behavior of some extended types can vary between compilers and standards versions. + +Visit the following resources to learn more: + +- [@article@C Extended Types](https://www.w3schools.com/c/c_data_types_extended.php) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/extern@BUnTFPsFmmYsZMiOrX09V.md b/src/data/roadmaps/c/content/extern@BUnTFPsFmmYsZMiOrX09V.md index f1180a019..6ca056ca3 100644 --- a/src/data/roadmaps/c/content/extern@BUnTFPsFmmYsZMiOrX09V.md +++ b/src/data/roadmaps/c/content/extern@BUnTFPsFmmYsZMiOrX09V.md @@ -1,3 +1,8 @@ # extern - -The `extern` keyword declares that a variable or function is defined in another file, giving the compiler the information it needs to reference it without allocating storage again. It is typically placed in a header file so multiple source files can share the same global variable or function. Using `extern` correctly avoids duplicate-definition errors that occur when a variable is accidentally defined in more than one file. \ No newline at end of file + +The `extern` keyword declares that a variable or function is defined in another file, giving the compiler the information it needs to reference it without allocating storage again. It is typically placed in a header file so multiple source files can share the same global variable or function. Using `extern` correctly avoids duplicate-definition errors that occur when a variable is accidentally defined in more than one file. + +Visit the following resources to learn more: + +- [@article@What is the Extern Keyword in C?](https://www.scaler.com/topics/c-extern/) +- [@video@Understanding the Extern Keyword in C](https://www.youtube.com/watch?v=ySY_FlA7EvA) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/file-io@kb0Sbn0UfrdSzXBBNA4XQ.md b/src/data/roadmaps/c/content/file-io@kb0Sbn0UfrdSzXBBNA4XQ.md index 8db159145..dc11aef9c 100644 --- a/src/data/roadmaps/c/content/file-io@kb0Sbn0UfrdSzXBBNA4XQ.md +++ b/src/data/roadmaps/c/content/file-io@kb0Sbn0UfrdSzXBBNA4XQ.md @@ -1,3 +1,10 @@ # File I/O - -File input/output in C is done through the standard library's stream-based functions, which let a program open, read from, write to, and close files. Streams abstract away the underlying operating system details of file access behind a consistent interface. File I/O also involves choosing between binary and text mode, which affects how certain characters, like line endings, are handled. \ No newline at end of file + +File input/output in C is done through the standard library's stream-based functions, which let a program open, read from, write to, and close files. Streams abstract away the underlying operating system details of file access behind a consistent interface. File I/O also involves choosing between binary and text mode, which affects how certain characters, like line endings, are handled. + +Visit the following resources to learn more: + +- [@article@C File Handling](https://www.programiz.com/c-programming/c-file-input-output) +- [@article@Exploring File I/O in C📁](https://dev.to/angelotheman/exploring-file-io-in-c-1j07) +- [@video@File Access Basics | C Programming Tutorial](https://www.youtube.com/watch?v=HQNsriyMhtY) +- [@video@Reading and Writing Files in C, two ways (fopen vs. open)](https://www.youtube.com/watch?v=BQJBe4IbsvQ) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/file-pointers@xa-U-kJDF6kHS2qSYE9s7.md b/src/data/roadmaps/c/content/file-pointers@xa-U-kJDF6kHS2qSYE9s7.md index 09cc92027..266bc2a24 100644 --- a/src/data/roadmaps/c/content/file-pointers@xa-U-kJDF6kHS2qSYE9s7.md +++ b/src/data/roadmaps/c/content/file-pointers@xa-U-kJDF6kHS2qSYE9s7.md @@ -1,3 +1,8 @@ # File Pointers - -A file pointer, of type `FILE *`, is returned by `fopen` and represents an open file along with its current read/write position and buffering state. It is passed to subsequent I/O functions like `fread`, `fwrite`, and `fclose` to identify which open file they should operate on. Every successfully opened file pointer should eventually be closed with `fclose` to flush any buffered data and release the underlying resource. \ No newline at end of file + +A file pointer, of type `FILE *`, is returned by `fopen` and represents an open file along with its current read/write position and buffering state. It is passed to subsequent I/O functions like `fread`, `fwrite`, and `fclose` to identify which open file they should operate on. Every successfully opened file pointer should eventually be closed with `fclose` to flush any buffered data and release the underlying resource. + +Visit the following resources to learn more: + +- [@article@C Files](https://www.w3schools.com/c/c_files.php) +- [@video@File Access Basics | C Programming Tutorial](https://www.youtube.com/watch?v=HQNsriyMhtY) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/fixed-width-integers@_3sjS_QVxUR48FEnb1t_d.md b/src/data/roadmaps/c/content/fixed-width-integers@_3sjS_QVxUR48FEnb1t_d.md index c54012378..21d6defe4 100644 --- a/src/data/roadmaps/c/content/fixed-width-integers@_3sjS_QVxUR48FEnb1t_d.md +++ b/src/data/roadmaps/c/content/fixed-width-integers@_3sjS_QVxUR48FEnb1t_d.md @@ -1,3 +1,8 @@ # Fixed-width integers - -Fixed-width integer types, defined in ``, such as `int32_t` or `uint8_t`, guarantee an exact bit width regardless of platform, unlike `int` or `long` whose sizes can vary. This makes them useful for writing portable code, especially in networking, file formats, and embedded systems where exact sizes matter. Using them avoids subtle bugs that arise from assuming a type's size without checking it. \ No newline at end of file + +Fixed-width integer types, defined in ``, such as `int32_t` or `uint8_t`, guarantee an exact bit width regardless of platform, unlike `int` or `long` whose sizes can vary. This makes them useful for writing portable code, especially in networking, file formats, and embedded systems where exact sizes matter. Using them avoids subtle bugs that arise from assuming a type's size without checking it. + +Visit the following resources to learn more: + +- [@article@C Fixed Width Integers](https://www.w3schools.com/c/c_fixed_width_ints.php) +- [@article@Fixed width integer types (since C99)](https://en.cppreference.com/c/types/integer) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/float@5Wshi-NH3c_fm9muMr-Ye.md b/src/data/roadmaps/c/content/float@5Wshi-NH3c_fm9muMr-Ye.md index ab09ead1c..254fac455 100644 --- a/src/data/roadmaps/c/content/float@5Wshi-NH3c_fm9muMr-Ye.md +++ b/src/data/roadmaps/c/content/float@5Wshi-NH3c_fm9muMr-Ye.md @@ -1,3 +1,8 @@ # float - -The `float` type stores single-precision floating-point numbers, meaning it can represent fractional values but with limited precision, typically around 6 to 7 significant decimal digits. It follows the IEEE 754 standard on most systems and takes up 4 bytes of memory. Because floating-point representation is inherently imprecise, comparing `float` values for exact equality is generally unreliable. \ No newline at end of file + +The `float` type stores single-precision floating-point numbers, meaning it can represent fractional values but with limited precision, typically around 6 to 7 significant decimal digits. It follows the IEEE 754 standard on most systems and takes up 4 bytes of memory. Because floating-point representation is inherently imprecise, comparing `float` values for exact equality is generally unreliable. + +Visit the following resources to learn more: + +- [@article@Float Data Type in C](https://data-flair.training/blogs/float-data-type-in-c/) +- [@video@Fundamental Data Types − Float, Double & Long Double](https://www.youtube.com/watch?v=vNeOx1rQ25E) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/for--while--do-while-loops@QIUhvd_EmL_eD1Fn03XWF.md b/src/data/roadmaps/c/content/for--while--do-while-loops@QIUhvd_EmL_eD1Fn03XWF.md index 3d73918c0..c392da2a9 100644 --- a/src/data/roadmaps/c/content/for--while--do-while-loops@QIUhvd_EmL_eD1Fn03XWF.md +++ b/src/data/roadmaps/c/content/for--while--do-while-loops@QIUhvd_EmL_eD1Fn03XWF.md @@ -1,3 +1,10 @@ # for / while / do while loops - -C offers three loop constructs: `for`, which bundles initialization, condition, and increment in one line and suits a known number of iterations; `while`, which checks its condition before each iteration and suits an unknown number of repetitions; and `do-while`, which checks its condition after each iteration, guaranteeing the loop body runs at least once. Choosing between them mostly comes down to whether the number of iterations is known ahead of time and whether the body must run at least once. \ No newline at end of file + +C offers three loop constructs: `for`, which bundles initialization, condition, and increment in one line and suits a known number of iterations; `while`, which checks its condition before each iteration and suits an unknown number of repetitions; and `do-while`, which checks its condition after each iteration, guaranteeing the loop body runs at least once. Choosing between them mostly comes down to whether the number of iterations is known ahead of time and whether the body must run at least once. + +Visit the following resources to learn more: + +- [@article@For Loop](https://www.tutorialspoint.com/cprogramming/c_for_loop.htm) +- [@article@While Loop](https://www.tutorialspoint.com/cprogramming/c_while_loop.htm) +- [@article@Do-While Loop](https://www.tutorialspoint.com/cprogramming/c_do_while_loop.htm) +- [@video@C for loops in 3 minutes! 🔁](https://www.youtube.com/watch?v=b4DPj0XAfSg) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/free@N0wFaqozA3K6UUJbTEeWr.md b/src/data/roadmaps/c/content/free@N0wFaqozA3K6UUJbTEeWr.md new file mode 100644 index 000000000..7c2f80eb0 --- /dev/null +++ b/src/data/roadmaps/c/content/free@N0wFaqozA3K6UUJbTEeWr.md @@ -0,0 +1,9 @@ +# free + +`free` is a standard library function used to deallocate a block of memory that was previously reserved on the heap. When you call this function, it releases the specified memory back to the system so that it can be used for other purposes in the program. Passing a pointer to the start of a previously allocated memory block to `free` effectively marks that space as available, though the pointer itself remains unchanged and should ideally be set to `NULL` immediately afterward to prevent accidental use of dangling references. + +Visit the following resources to learn more: + +- [@article@C Deallocate Memory](https://www.w3schools.com/c/c_memory_deallocate.php) +- [@article@C library - free() function](https://www.tutorialspoint.com/c_standard_library/c_function_free.htm) +- [@video@Releasing the Dynamically Allocated Memory using free()](https://www.youtube.com/watch?v=qG0wUzuBI_A) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/function-pointers--callbacks@yAnN3Fk_S3Nx2USXSR-vq.md b/src/data/roadmaps/c/content/function-pointers--callbacks@yAnN3Fk_S3Nx2USXSR-vq.md index 309f8df50..428e374cc 100644 --- a/src/data/roadmaps/c/content/function-pointers--callbacks@yAnN3Fk_S3Nx2USXSR-vq.md +++ b/src/data/roadmaps/c/content/function-pointers--callbacks@yAnN3Fk_S3Nx2USXSR-vq.md @@ -1,3 +1,9 @@ # Function pointers & Callbacks - -A function pointer stores the address of a function, allowing that function to be called indirectly, passed as an argument, or stored in a data structure, similar to how a regular pointer stores the address of a variable. Callbacks use this to let one function invoke another that is decided at runtime, a pattern used by standard library functions like `qsort`, which takes a comparison function as a callback. This mechanism underlies more advanced patterns in C, including simulating object-oriented dispatch through structs containing function pointers. \ No newline at end of file + +A function pointer stores the address of a function, allowing that function to be called indirectly, passed as an argument, or stored in a data structure, similar to how a regular pointer stores the address of a variable. Callbacks use this to let one function invoke another that is decided at runtime, a pattern used by standard library functions like `qsort`, which takes a comparison function as a callback. This mechanism underlies more advanced patterns in C, including simulating object-oriented dispatch through structs containing function pointers. + +Visit the following resources to learn more: + +- [@article@Function Pointers](https://www.w3schools.com/c/c_functions_pointers.php) +- [@article@Making Function Pointers Usable In C](https://vandervoord.net/blog/2015/6/2/making-function-pointers-usable-in-c) +- [@video@Function Pointers in C](https://www.youtube.com/watch?v=BRsv3ZXoHto) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/functions@Ap1G1kpE5IPNXhraizogH.md b/src/data/roadmaps/c/content/functions@Ap1G1kpE5IPNXhraizogH.md index 0e1b86637..628350d8a 100644 --- a/src/data/roadmaps/c/content/functions@Ap1G1kpE5IPNXhraizogH.md +++ b/src/data/roadmaps/c/content/functions@Ap1G1kpE5IPNXhraizogH.md @@ -1,3 +1,10 @@ # Functions - -A function in C is a named, reusable block of code that takes inputs (parameters), performs some computation, and optionally returns a value. Functions must be declared, either with a prototype or a full definition, before they are used, so the compiler knows their expected parameter and return types. Breaking a program into functions makes code easier to read, test, and reuse. \ No newline at end of file + +A function in C is a named, reusable block of code that takes inputs (parameters), performs some computation, and optionally returns a value. Functions must be declared, either with a prototype or a full definition, before they are used, so the compiler knows their expected parameter and return types. Breaking a program into functions makes code easier to read, test, and reuse. + +Visit the following resources to learn more: + +- [@article@Functions in C](https://www.tutorialspoint.com/cprogramming/c_functions.htm) +- [@article@C Functions](https://www.w3schools.com/c/c_functions.php) +- [@video@C functions 📞](https://www.youtube.com/watch?v=ou_G7_zodR4) +- [@video@Function Basics | C Programming Tutorial](https://www.youtube.com/watch?v=NGQoKF2Ggt8) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/gcc--clang@Pz0ENibKam0gHfLiJIGF1.md b/src/data/roadmaps/c/content/gcc--clang@Pz0ENibKam0gHfLiJIGF1.md index 22ee0c2c2..7c6da60e0 100644 --- a/src/data/roadmaps/c/content/gcc--clang@Pz0ENibKam0gHfLiJIGF1.md +++ b/src/data/roadmaps/c/content/gcc--clang@Pz0ENibKam0gHfLiJIGF1.md @@ -1,3 +1,10 @@ # GCC / Clang - -GCC (GNU Compiler Collection) and Clang are two widely used, open-source C compilers, each supporting multiple platforms and largely compatible command-line interfaces. GCC has a longer history and broader platform support, while Clang is known for faster compilation, more readable error messages, and being built on the LLVM compiler infrastructure. Both support similar optimization flags and standard compliance modes, making it common for projects to test against both. \ No newline at end of file + +GCC (GNU Compiler Collection) and Clang are two widely used, open-source C compilers, each supporting multiple platforms and largely compatible command-line interfaces. GCC has a longer history and broader platform support, while Clang is known for faster compilation, more readable error messages, and being built on the LLVM compiler infrastructure. Both support similar optimization flags and standard compliance modes, making it common for projects to test against both. + +Visit the following resources to learn more: + +- [@article@A programmer's guide to GNU C Compiler](https://opensource.com/article/22/5/gnu-c-compiler) +- [@article@GNU Compiler Collection](https://en.wikipedia.org/wiki/GNU_Compiler_Collection) +- [@article@Getting Started with Clang](https://clang.llvm.org/get_started.html) +- [@video@LLVM in 100 Seconds](https://www.youtube.com/watch?v=BT2Cv-Tjq7Q) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/gdb@5jGEjmELi7U68fPdKLbel.md b/src/data/roadmaps/c/content/gdb@5jGEjmELi7U68fPdKLbel.md index 54bffed04..5db4a24aa 100644 --- a/src/data/roadmaps/c/content/gdb@5jGEjmELi7U68fPdKLbel.md +++ b/src/data/roadmaps/c/content/gdb@5jGEjmELi7U68fPdKLbel.md @@ -1,3 +1,9 @@ # GDB - -GDB (GNU Debugger) is a command-line debugger that lets a programmer run a C program under its control, set breakpoints to pause execution at specific lines, inspect and modify variable values, and step through code one line or instruction at a time. It works with binaries compiled with debugging information, typically added using the `-g` compiler flag. GDB is the standard debugger on most Linux systems and supports many other languages beyond C. \ No newline at end of file + +GDB (GNU Debugger) is a command-line debugger that lets a programmer run a C program under its control, set breakpoints to pause execution at specific lines, inspect and modify variable values, and step through code one line or instruction at a time. It works with binaries compiled with debugging information, typically added using the `-g` compiler flag. GDB is the standard debugger on most Linux systems and supports many other languages beyond C. + +Visit the following resources to learn more: + +- [@official@GDB Docs](https://www.sourceware.org/gdb/) +- [@article@Debugging C code With GDB](https://medium.com/havingfun/debugging-c-code-with-gdb-90adb2f3da96) +- [@video@GDB is REALLY easy! Find Bugs in Your Code with Only A Few Commands](https://www.youtube.com/watch?v=Dq8l1_-QgAc) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/gnu-make@e-9jBLdJEEZkD7g6Ahr5g.md b/src/data/roadmaps/c/content/gnu-make@e-9jBLdJEEZkD7g6Ahr5g.md index 32d9df8a5..d44acb729 100644 --- a/src/data/roadmaps/c/content/gnu-make@e-9jBLdJEEZkD7g6Ahr5g.md +++ b/src/data/roadmaps/c/content/gnu-make@e-9jBLdJEEZkD7g6Ahr5g.md @@ -1,3 +1,9 @@ # GNU Make - -GNU Make is a build automation tool that reads a file called a Makefile, containing rules that specify how to build targets from their dependencies, and only rebuilds the parts of a project that have actually changed. It is one of the oldest and most widely available build tools on Unix-like systems. Writing Makefiles by hand for larger projects can become complex, which is part of why higher-level tools like CMake are often used to generate them instead. \ No newline at end of file + +GNU Make is a build automation tool that reads a file called a Makefile, containing rules that specify how to build targets from their dependencies, and only rebuilds the parts of a project that have actually changed. It is one of the oldest and most widely available build tools on Unix-like systems. Writing Makefiles by hand for larger projects can become complex, which is part of why higher-level tools like CMake are often used to generate them instead. + +Visit the following resources to learn more: + +- [@official@GNU Make](https://ftp.gnu.org/old-gnu/Manuals/make-3.80/html_node/make.html) +- [@article@A Simple Makefile Tutorial](https://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/) +- [@video@What is GNU Make?](https://www.youtube.com/watch?v=mQupK2oTPF4) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/hash-maps@Vz3EG6Ceht0jJQMWzRxnc.md b/src/data/roadmaps/c/content/hash-maps@Vz3EG6Ceht0jJQMWzRxnc.md index c40e125a9..2f9f4198c 100644 --- a/src/data/roadmaps/c/content/hash-maps@Vz3EG6Ceht0jJQMWzRxnc.md +++ b/src/data/roadmaps/c/content/hash-maps@Vz3EG6Ceht0jJQMWzRxnc.md @@ -1,3 +1,8 @@ # Hash Maps - -A hash map stores key-value pairs and uses a hash function to convert each key into an index into an underlying array, allowing average constant-time lookup, insertion, and deletion. Since C has no built-in hash map, implementing one involves writing a hash function, handling collisions when two keys hash to the same index, and managing the underlying array's resizing. Common collision-handling strategies include chaining, where colliding entries form a linked list, and open addressing, where the map probes for the next free slot. \ No newline at end of file + +A hash map stores key-value pairs and uses a hash function to convert each key into an index into an underlying array, allowing average constant-time lookup, insertion, and deletion. Since C has no built-in hash map, implementing one involves writing a hash function, handling collisions when two keys hash to the same index, and managing the underlying array's resizing. Common collision-handling strategies include chaining, where colliding entries form a linked list, and open addressing, where the map probes for the next free slot. + +Visit the following resources to learn more: + +- [@article@How to implement a hash table (in C)](https://benhoyt.com/writings/hash-table-in-c/) +- [@video@Understanding and implementing a Hash Table (in C)](https://www.youtube.com/watch?v=2Ti5yvumFTU) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/header-files@SwEkB8-m2yhdJVakktJFJ.md b/src/data/roadmaps/c/content/header-files@SwEkB8-m2yhdJVakktJFJ.md index 586f83977..e160cd5c1 100644 --- a/src/data/roadmaps/c/content/header-files@SwEkB8-m2yhdJVakktJFJ.md +++ b/src/data/roadmaps/c/content/header-files@SwEkB8-m2yhdJVakktJFJ.md @@ -1,3 +1,9 @@ # Header Files - -Header files, with a `.h` extension, contain declarations, such as function prototypes, struct definitions, and macros, that are shared across multiple source files using `#include`. They let multiple `.c` files agree on the same interface without duplicating code. Header guards, or `#pragma once`, prevent the same header from being included multiple times in one compilation, which would otherwise cause duplicate-definition errors. \ No newline at end of file + +Header files, with a `.h` extension, contain declarations, such as function prototypes, struct definitions, and macros, that are shared across multiple source files using `#include`. They let multiple `.c` files agree on the same interface without duplicating code. Header guards, or `#pragma once`, prevent the same header from being included multiple times in one compilation, which would otherwise cause duplicate-definition errors. + +Visit the following resources to learn more: + +- [@article@Header Files in C](https://www.tutorialspoint.com/cprogramming/c_header_files.htm) +- [@article@C Organize Code](https://www.w3schools.com/c/c_organize_code.php) +- [@video@why do header files even exist?](https://www.youtube.com/watch?v=tOQZlD-0Scc) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/idioms--design-patterns@svLpkz24gcGxwQ3L5b6SH.md b/src/data/roadmaps/c/content/idioms--design-patterns@svLpkz24gcGxwQ3L5b6SH.md index ddc1cbe66..845f23189 100644 --- a/src/data/roadmaps/c/content/idioms--design-patterns@svLpkz24gcGxwQ3L5b6SH.md +++ b/src/data/roadmaps/c/content/idioms--design-patterns@svLpkz24gcGxwQ3L5b6SH.md @@ -1,3 +1,8 @@ # Idioms & Design Patterns - -Idioms and design patterns in C are established techniques for achieving goals, like encapsulation or polymorphism, that the language does not support directly through built-in syntax the way object-oriented languages do. These patterns typically combine structs, function pointers, and careful use of pointers and headers to simulate features from higher-level languages. Recognizing them helps when reading existing C codebases, since many rely on these conventions rather than documenting the intent explicitly. \ No newline at end of file + +Idioms and design patterns in C are established techniques for achieving goals, like encapsulation or polymorphism, that the language does not support directly through built-in syntax the way object-oriented languages do. These patterns typically combine structs, function pointers, and careful use of pointers and headers to simulate features from higher-level languages. Recognizing them helps when reading existing C codebases, since many rely on these conventions rather than documenting the intent explicitly. + +Visit the following resources to learn more: + +- [@article@Idioms for C programmers](https://www.cs.tufts.edu/comp/40-2011f/idioms.html) +- [@video@Tips for C Programming](https://www.youtube.com/watch?v=9UIIMBqq1D4) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/if-else--switch@xSnR4hOm243pyPl1S2xjr.md b/src/data/roadmaps/c/content/if-else--switch@xSnR4hOm243pyPl1S2xjr.md index 680ac99dd..c4039da5e 100644 --- a/src/data/roadmaps/c/content/if-else--switch@xSnR4hOm243pyPl1S2xjr.md +++ b/src/data/roadmaps/c/content/if-else--switch@xSnR4hOm243pyPl1S2xjr.md @@ -1,3 +1,10 @@ # if else / switch - -The `if`/`else` statement branches execution based on whether a condition evaluates to true or false, and can be chained with `else if` for multiple conditions. The `switch` statement compares a single value against several possible cases and is often clearer than a long `if`/`else if` chain when checking one variable against many fixed values. Forgetting a `break` at the end of a `switch` case causes execution to fall through into the next case, which is a common source of bugs. \ No newline at end of file + +The `if`/`else` statement branches execution based on whether a condition evaluates to true or false, and can be chained with `else if` for multiple conditions. The `switch` statement compares a single value against several possible cases and is often clearer than a long `if`/`else if` chain when checking one variable against many fixed values. Forgetting a `break` at the end of a `switch` case causes execution to fall through into the next case, which is a common source of bugs. + +Visit the following resources to learn more: + +- [@article@If Statement](https://www.tutorialspoint.com/cprogramming/if_statement_in_c.htm) +- [@article@Switch Statement in C](https://www.tutorialspoint.com/cprogramming/switch_statement_in_c.htm) +- [@video@Conditionals (if-else, Nested if and else if)](https://www.youtube.com/watch?v=Led5aHdLoT4&list=PLBlnK6fEyqRgZq4a-SMViZr-V8jlvCioJ&index=1) +- [@video@Conditionals (Switch)](https://www.youtube.com/watch?v=-JMSaLRqsgo&list=PLBlnK6fEyqRgZq4a-SMViZr-V8jlvCioJ&index=2) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/initialization@W7zr2sfw5Lb_H5IujvEq-.md b/src/data/roadmaps/c/content/initialization@W7zr2sfw5Lb_H5IujvEq-.md index 356084bc0..a48f336ab 100644 --- a/src/data/roadmaps/c/content/initialization@W7zr2sfw5Lb_H5IujvEq-.md +++ b/src/data/roadmaps/c/content/initialization@W7zr2sfw5Lb_H5IujvEq-.md @@ -1,3 +1,7 @@ # Initialization - -Initialization is giving a variable its first value at the point it is created, as in `int count = 0;`. Uninitialized local variables in C hold indeterminate values, whatever bits happened to be in that memory location before, so reading one before assigning it produces undefined behavior. Global and static variables are automatically initialized to zero if no explicit value is given, but local variables are not. \ No newline at end of file + +Initialization is giving a variable its first value at the point it is created, as in `int count = 0;`. Uninitialized local variables in C hold indeterminate values, whatever bits happened to be in that memory location before, so reading one before assigning it produces undefined behavior. Global and static variables are automatically initialized to zero if no explicit value is given, but local variables are not. + +Visit the following resources to learn more: + +- [@article@C - Variables](https://www.tutorialspoint.com/cprogramming/c_variables.htm) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/input--output@MSWKzt42QsalPJaMBaYer.md b/src/data/roadmaps/c/content/input--output@MSWKzt42QsalPJaMBaYer.md index 2c710e7fb..c7c20c735 100644 --- a/src/data/roadmaps/c/content/input--output@MSWKzt42QsalPJaMBaYer.md +++ b/src/data/roadmaps/c/content/input--output@MSWKzt42QsalPJaMBaYer.md @@ -1,3 +1,8 @@ # Input / Output - -The standard library's I/O functions, declared mainly in ``, handle reading from and writing to streams, including the console and files. Common functions include `printf` and `scanf` for formatted console I/O, and `fopen`, `fread`, and `fwrite` for file access. These functions form the primary way a C program interacts with the outside world during execution. \ No newline at end of file + +The standard library's I/O functions, declared mainly in ``, handle reading from and writing to streams, including the console and files. Common functions include `printf` and `scanf` for formatted console I/O, and `fopen`, `fread`, and `fwrite` for file access. These functions form the primary way a C program interacts with the outside world during execution. + +Visit the following resources to learn more: + +- [@article@File input/output](https://cppreference.com/c/io) +- [@video@File Access Basics | C Programming Tutorial](https://www.youtube.com/watch?v=HQNsriyMhtY) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/installing-c@e7SlvxdKrmuqdZPAmJ6Z6.md b/src/data/roadmaps/c/content/installing-c@e7SlvxdKrmuqdZPAmJ6Z6.md index 34bf51ac5..ceac4eb80 100644 --- a/src/data/roadmaps/c/content/installing-c@e7SlvxdKrmuqdZPAmJ6Z6.md +++ b/src/data/roadmaps/c/content/installing-c@e7SlvxdKrmuqdZPAmJ6Z6.md @@ -1,3 +1,8 @@ # Installing C - -Installing C means installing a compiler such as GCC or Clang, since C itself is just a language specification with no official installer. On Linux, package managers like apt or dnf usually provide GCC directly. On macOS, Xcode Command Line Tools include Clang, and on Windows, options include MinGW, WSL, or MSVC. Once installed, running the compiler on a small test file confirms the setup works. \ No newline at end of file + +Installing C means installing a compiler such as GCC or Clang, since C itself is just a language specification with no official installer. On Linux, package managers like apt or dnf usually provide GCC directly. On macOS, Xcode Command Line Tools include Clang, and on Windows, options include MinGW, WSL, or MSVC. Once installed, running the compiler on a small test file confirms the setup works. + +Visit the following resources to learn more: + +- [@article@C - Environment Setup](https://www.tutorialspoint.com/cprogramming/c_environment_setup.htm) +- [@video@ES Skip navigation installing c Create Avatar image How to Set up Visual Studio Code for C and C++ Programming](https://www.youtube.com/watch?v=1PBD5qFWdq8) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/integers@wf30TwIenxNMA2eXe69Tu.md b/src/data/roadmaps/c/content/integers@wf30TwIenxNMA2eXe69Tu.md index 51b4a9e95..012aac479 100644 --- a/src/data/roadmaps/c/content/integers@wf30TwIenxNMA2eXe69Tu.md +++ b/src/data/roadmaps/c/content/integers@wf30TwIenxNMA2eXe69Tu.md @@ -1,3 +1,8 @@ # integers - -Integer types in C, such as `int`, `short`, and `long`, store whole numbers without a fractional part. Their exact size in bytes is not fixed by the language and can vary between platforms, though `int` is commonly 4 bytes on modern systems. Integers can be signed, allowing negative values, or unsigned, doubling the positive range but disallowing negatives, and choosing the wrong one is a frequent source of bugs. \ No newline at end of file + +Integer types in C, such as `int`, `short`, and `long`, store whole numbers without a fractional part. Their exact size in bytes is not fixed by the language and can vary between platforms, though `int` is commonly 4 bytes on modern systems. Integers can be signed, allowing negative values, or unsigned, doubling the positive range but disallowing negatives, and choosing the wrong one is a frequent source of bugs. + +Visit the following resources to learn more: + +- [@article@Integer types](https://www.cs.yale.edu/homes/aspnes/pinewiki/C(2f)IntegerTypes.html) +- [@video@Fundamental Data Types − Integer (Part 1)](https://www.youtube.com/watch?v=_9bAlgRzlkc) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/introduction@P5PQ8Pw9hBv5oM-Trrgic.md b/src/data/roadmaps/c/content/introduction@P5PQ8Pw9hBv5oM-Trrgic.md index 2c6235e0b..85a7c1452 100644 --- a/src/data/roadmaps/c/content/introduction@P5PQ8Pw9hBv5oM-Trrgic.md +++ b/src/data/roadmaps/c/content/introduction@P5PQ8Pw9hBv5oM-Trrgic.md @@ -1,3 +1,10 @@ # Introduction - -C is a general-purpose programming language created in the early 1970s at Bell Labs by Dennis Ritchie. It gives direct access to memory and hardware while staying close to the machine, which makes it fast and predictable but also demands more care from the programmer. Operating systems, embedded firmware, compilers, and many other languages' runtimes are built with it. Learning C teaches how computers actually manage memory and execute instructions, knowledge that carries over to almost every other language. \ No newline at end of file + +C is a general-purpose programming language created in the early 1970s at Bell Labs by Dennis Ritchie. It gives direct access to memory and hardware while staying close to the machine, which makes it fast and predictable but also demands more care from the programmer. Operating systems, embedded firmware, compilers, and many other languages' runtimes are built with it. Learning C teaches how computers actually manage memory and execute instructions, knowledge that carries over to almost every other language. + +Visit the following resources to learn more: + +- [@course@Learn C](https://www.learn-c.org/) +- [@book@The C Programming Language - 2nd Edition](https://seriouscomputerist.atariverse.com/media/pdf/book/C%20Programming%20Language%20-%202nd%20Edition%20(OCR).pdf) +- [@video@C Programming and Memory Management - Full Course](https://www.youtube.com/watch?v=rJrd2QMVbGM) +- [@article@C Programming Full Course for free ⚙️](https://www.youtube.com/watch?v=xND0t1pr3KY) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/intrusive-data-structures@H3YWNa07EK30ZLOSDxUoW.md b/src/data/roadmaps/c/content/intrusive-data-structures@H3YWNa07EK30ZLOSDxUoW.md index e91564bbd..de748d0fc 100644 --- a/src/data/roadmaps/c/content/intrusive-data-structures@H3YWNa07EK30ZLOSDxUoW.md +++ b/src/data/roadmaps/c/content/intrusive-data-structures@H3YWNa07EK30ZLOSDxUoW.md @@ -1,3 +1,3 @@ # Intrusive Data Structures - + An intrusive data structure embeds the structural elements needed for a container, such as the next-pointer for a linked list, directly inside the data type being stored, rather than wrapping the data in a separate container node. This avoids extra memory allocation for container-specific nodes and lets the same piece of data belong to multiple intrusive structures simultaneously. The Linux kernel makes heavy use of this pattern for its internal linked lists. \ No newline at end of file diff --git a/src/data/roadmaps/c/content/ipc@3HSmsfQga_i8bAaJwWYJB.md b/src/data/roadmaps/c/content/ipc@3HSmsfQga_i8bAaJwWYJB.md index 265dd814e..322d418a9 100644 --- a/src/data/roadmaps/c/content/ipc@3HSmsfQga_i8bAaJwWYJB.md +++ b/src/data/roadmaps/c/content/ipc@3HSmsfQga_i8bAaJwWYJB.md @@ -1,3 +1,9 @@ # IPC - -Inter-process communication (IPC) covers mechanisms that let separate, independent processes exchange data, since processes do not share memory the way threads within one process do. Common IPC mechanisms include pipes for streaming data between related processes, shared memory segments for faster but more manually managed data sharing, and message queues or sockets for more structured or networked communication. Choosing an IPC mechanism depends on factors like whether the processes are on the same machine and how much data needs to move between them. \ No newline at end of file + +Inter-process communication (IPC) covers mechanisms that let separate, independent processes exchange data, since processes do not share memory the way threads within one process do. Common IPC mechanisms include pipes for streaming data between related processes, shared memory segments for faster but more manually managed data sharing, and message queues or sockets for more structured or networked communication. Choosing an IPC mechanism depends on factors like whether the processes are on the same machine and how much data needs to move between them. + +Visit the following resources to learn more: + +- [@article@Inter Process communication](https://kuleuven-diepenbeek.github.io/osc-course/ch6-tasks/interprocess/) +- [@article@IPC: Inter-process communication in C programming](http://medium.com/@CesarPrz/ipc-inter-process-communication-in-c-programming-1d9069edc27f) +- [@video@Interprocess Communication](https://www.youtube.com/watch?v=dJuYKfR8vec) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/lifetime-of-objects@hDe6JcTOGQBYfGLFJmacW.md b/src/data/roadmaps/c/content/lifetime-of-objects@hDe6JcTOGQBYfGLFJmacW.md index 78dc7d700..b7e9a1dd9 100644 --- a/src/data/roadmaps/c/content/lifetime-of-objects@hDe6JcTOGQBYfGLFJmacW.md +++ b/src/data/roadmaps/c/content/lifetime-of-objects@hDe6JcTOGQBYfGLFJmacW.md @@ -1,3 +1,7 @@ # Lifetime of Objects - -The lifetime of an object is the period during program execution when its memory is guaranteed to hold valid data. Local variables on the stack typically live only until the enclosing block exits, static and global variables live for the entire program, and heap-allocated memory lives until it is explicitly freed. Accessing an object outside its lifetime, such as reading a stack variable after its function has returned, produces undefined behavior. \ No newline at end of file + +The lifetime of an object is the period during program execution when its memory is guaranteed to hold valid data. Local variables on the stack typically live only until the enclosing block exits, static and global variables live for the entire program, and heap-allocated memory lives until it is explicitly freed. Accessing an object outside its lifetime, such as reading a stack variable after its function has returned, produces undefined behavior. + +Visit the following resources to learn more: + +- [@article@Lifetime](https://en.cppreference.com/c/language/lifetime#:~:text=Every%20object%20in%20C%20exists,known%20as%20this%20object's%20lifetime.) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/linkage@BVM_NAKegerqPp1GqxymX.md b/src/data/roadmaps/c/content/linkage@BVM_NAKegerqPp1GqxymX.md index 29d68dcbe..5baae5e04 100644 --- a/src/data/roadmaps/c/content/linkage@BVM_NAKegerqPp1GqxymX.md +++ b/src/data/roadmaps/c/content/linkage@BVM_NAKegerqPp1GqxymX.md @@ -1,3 +1,8 @@ # Linkage - -Linkage determines whether a name, like a variable or function, refers to the same entity when it appears in multiple files. External linkage means the name is visible and shared across files, internal linkage restricts it to the file it is defined in, and no linkage applies to names like local variables that exist only within a block. Linkage is controlled with the `static` and `extern` keywords at file scope. \ No newline at end of file + +Linkage determines whether a name, like a variable or function, refers to the same entity when it appears in multiple files. External linkage means the name is visible and shared across files, internal linkage restricts it to the file it is defined in, and no linkage applies to names like local variables that exist only within a block. Linkage is controlled with the `static` and `extern` keywords at file scope. + +Visit the following resources to learn more: + +- [@article@Linkage in C and C++](https://www.embedded.com/linkage-in-c-and-c/) +- [@video@Storage Duration and Linkage in C and C++ - Dan Saks](https://www.youtube.com/watch?v=0kgTuWkyorc) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/linked-lists@_gCygh71kFo_Xrja7_YlL.md b/src/data/roadmaps/c/content/linked-lists@_gCygh71kFo_Xrja7_YlL.md index ecd152c88..39786656d 100644 --- a/src/data/roadmaps/c/content/linked-lists@_gCygh71kFo_Xrja7_YlL.md +++ b/src/data/roadmaps/c/content/linked-lists@_gCygh71kFo_Xrja7_YlL.md @@ -1,3 +1,8 @@ # Linked Lists - -A linked list stores a sequence of elements as separate nodes, where each node contains a value and a pointer to the next node, rather than storing elements contiguously like an array. This makes inserting or removing elements in the middle of the list efficient, since it only requires updating a few pointers, but accessing an arbitrary element requires walking the list from the start. Variants include singly linked lists, doubly linked lists with pointers in both directions, and circular linked lists. \ No newline at end of file + +A linked list stores a sequence of elements as separate nodes, where each node contains a value and a pointer to the next node, rather than storing elements contiguously like an array. This makes inserting or removing elements in the middle of the list efficient, since it only requires updating a few pointers, but accessing an arbitrary element requires walking the list from the start. Variants include singly linked lists, doubly linked lists with pointers in both directions, and circular linked lists. + +Visit the following resources to learn more: + +- [@article@Linked lists](https://www.learn-c.org/en/Linked_lists) +- [@video@Understanding and implementing a Linked List in C and Java](https://www.youtube.com/watch?v=VOpjAHCee7c) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/linking@SKmlpSWapjwnTGngx5qtI.md b/src/data/roadmaps/c/content/linking@SKmlpSWapjwnTGngx5qtI.md index 005efcf88..75d170f02 100644 --- a/src/data/roadmaps/c/content/linking@SKmlpSWapjwnTGngx5qtI.md +++ b/src/data/roadmaps/c/content/linking@SKmlpSWapjwnTGngx5qtI.md @@ -1,3 +1,9 @@ # Linking - -Linking is the stage after compilation that combines multiple object files and libraries into a single executable, resolving references between them, such as a function called in one file but defined in another. A linker error occurs when a referenced symbol cannot be found anywhere among the provided object files and libraries. Linking can happen statically, embedding library code directly into the executable, or dynamically, where the executable references a shared library loaded at runtime. \ No newline at end of file + +Linking is the stage after compilation that combines multiple object files and libraries into a single executable, resolving references between them, such as a function called in one file but defined in another. A linker error occurs when a referenced symbol cannot be found anywhere among the provided object files and libraries. Linking can happen statically, embedding library code directly into the executable, or dynamically, where the executable references a shared library loaded at runtime. + +Visit the following resources to learn more: + +- [@article@The Four Stages of Compiling a C Program](https://www.calleluks.com/the-four-stages-of-compiling-a-c-program/) +- [@article@Compiling and Linking](https://www.cprogramming.com/compilingandlinking.html) +- [@video@Compiling, assembling, and linking](https://www.youtube.com/watch?v=N2y6csonII4) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/lldb@GRW6VzOtJdVGA_ErIMwoN.md b/src/data/roadmaps/c/content/lldb@GRW6VzOtJdVGA_ErIMwoN.md index ce7881d46..91754f5bb 100644 --- a/src/data/roadmaps/c/content/lldb@GRW6VzOtJdVGA_ErIMwoN.md +++ b/src/data/roadmaps/c/content/lldb@GRW6VzOtJdVGA_ErIMwoN.md @@ -1,3 +1,9 @@ # LLDB - -LLDB is a debugger built as part of the LLVM project, offering similar functionality to GDB, including breakpoints, stepping through code, and inspecting variables, with a largely compatible but distinct command syntax. It is the default debugger bundled with Xcode on macOS and integrates closely with Clang-compiled binaries. Many IDEs use LLDB under the hood on Apple platforms. \ No newline at end of file + +LLDB is a debugger built as part of the LLVM project, offering similar functionality to GDB, including breakpoints, stepping through code, and inspecting variables, with a largely compatible but distinct command syntax. It is the default debugger bundled with Xcode on macOS and integrates closely with Clang-compiled binaries. Many IDEs use LLDB under the hood on Apple platforms. + +Visit the following resources to learn more: + +- [@official@LLDB Tutorial](https://lldb.llvm.org/use/tutorial.html) +- [@article@The LLDB debugger](https://docs.redhat.com/en/documentation/red_hat_developer_tools/1/html/using_llvm_13.0.1_toolset/assembly_the-lldb-debugger) +- [@video@Debugging C/C++ with LLDB Tutorial](https://www.youtube.com/watch?v=2GV0K9Y2MKA) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/logical@NTVnzG3gY5OTIlAJWG3Kr.md b/src/data/roadmaps/c/content/logical@NTVnzG3gY5OTIlAJWG3Kr.md index c1471e2a5..f26c0502a 100644 --- a/src/data/roadmaps/c/content/logical@NTVnzG3gY5OTIlAJWG3Kr.md +++ b/src/data/roadmaps/c/content/logical@NTVnzG3gY5OTIlAJWG3Kr.md @@ -1,3 +1,7 @@ # Logical - -Logical operators, `&&` (AND), `||` (OR), and `!` (NOT), combine or invert boolean conditions and are typically used in control flow statements. C uses short-circuit evaluation, meaning `&&` stops evaluating as soon as one operand is false, and `||` stops as soon as one operand is true. This behavior is often relied on deliberately, for example checking a pointer is not null before dereferencing it in the same condition. \ No newline at end of file + +Logical operators, `&&` (AND), `||` (OR), and `!` (NOT), combine or invert boolean conditions and are typically used in control flow statements. C uses short-circuit evaluation, meaning `&&` stops evaluating as soon as one operand is false, and `||` stops as soon as one operand is true. This behavior is often relied on deliberately, for example checking a pointer is not null before dereferencing it in the same condition. + +Visit the following resources to learn more: + +- [@article@Logical Operators in C](https://www.tutorialspoint.com/cprogramming/c_logical_operators.htm) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/macros@ixFrXXh8oKx2SYjHRzW-G.md b/src/data/roadmaps/c/content/macros@ixFrXXh8oKx2SYjHRzW-G.md index 33ba92b73..cef03f85e 100644 --- a/src/data/roadmaps/c/content/macros@ixFrXXh8oKx2SYjHRzW-G.md +++ b/src/data/roadmaps/c/content/macros@ixFrXXh8oKx2SYjHRzW-G.md @@ -1,3 +1,9 @@ # Macros - -A macro, defined with `#define`, is a preprocessor directive that gives a name to a piece of code, which is then substituted wherever that name appears before compilation. Macros can be simple constants, like `#define PI 3.14159`, or function-like, taking parameters and expanding into a code pattern. Because macro expansion is purely textual, careless macros without proper parentheses around their parameters can produce surprising results when combined with other operators. \ No newline at end of file + +A macro, defined with `#define`, is a preprocessor directive that gives a name to a piece of code, which is then substituted wherever that name appears before compilation. Macros can be simple constants, like `#define PI 3.14159`, or function-like, taking parameters and expanding into a code pattern. Because macro expansion is purely textual, careless macros without proper parentheses around their parameters can produce surprising results when combined with other operators. + +Visit the following resources to learn more: + +- [@article@What are Macros in C? Types, Examples and Benefits](https://www.almabetter.com/bytes/articles/macros-in-c) +- [@article@C/Macros](https://www.cs.yale.edu/homes/aspnes/pinewiki/C(2f)Macros.html) +- [@video@How to Write Function-Like Preprocessor Macros (C example)](https://www.youtube.com/watch?v=w3iXBUbq4NY) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/main-function@mjelrh_5unRJ3uWXd42zz.md b/src/data/roadmaps/c/content/main-function@mjelrh_5unRJ3uWXd42zz.md new file mode 100644 index 000000000..91ca81e75 --- /dev/null +++ b/src/data/roadmaps/c/content/main-function@mjelrh_5unRJ3uWXd42zz.md @@ -0,0 +1,8 @@ +# main Function + +The `main` function serves as the designated entry point where the execution of every C program begins. When a program is run, the operating system calls this specific function to start the sequence of instructions defined within the code. It typically returns an integer value to the operating system upon completion, where a return value of zero indicates that the program finished successfully. + +Visit the following resources to learn more: + +- [@article@C main Function](https://www.tutorialspoint.com/cprogramming/c_main_function.htm) +- [@video@Details about the main function](https://www.youtube.com/watch?v=2dsSGnmbXNM) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/malloc@g-OyeBMZCusiE7nZ0UYrM.md b/src/data/roadmaps/c/content/malloc@g-OyeBMZCusiE7nZ0UYrM.md new file mode 100644 index 000000000..f17770122 --- /dev/null +++ b/src/data/roadmaps/c/content/malloc@g-OyeBMZCusiE7nZ0UYrM.md @@ -0,0 +1,9 @@ +# malloc + +`malloc` is a function used to reserve a specific amount of memory during the execution of a program. When called, it allocates a block of memory of a requested size in bytes on the heap and returns a pointer to the first byte of that block. If the system cannot provide the requested memory, the function returns a null pointer to indicate that the allocation failed. + +Visit the following resources to learn more: + +- [@article@C Allocate Memory](https://www.w3schools.com/c/c_memory_allocate.php) +- [@article@C library - malloc() function](https://www.tutorialspoint.com/c_standard_library/c_function_malloc.htm) +- [@video@Malloc in C is easy! 🏢](https://www.youtube.com/watch?v=n_Se6bt8jM0) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/math--time@WUOL09d1l-Bxzn9g1sjlo.md b/src/data/roadmaps/c/content/math--time@WUOL09d1l-Bxzn9g1sjlo.md index e6d7914e7..3c3bfa389 100644 --- a/src/data/roadmaps/c/content/math--time@WUOL09d1l-Bxzn9g1sjlo.md +++ b/src/data/roadmaps/c/content/math--time@WUOL09d1l-Bxzn9g1sjlo.md @@ -1,3 +1,8 @@ # Math & Time - -Math functions, from ``, provide operations like square roots, trigonometric functions, and logarithms that go beyond the basic arithmetic operators. Time functions, from ``, handle getting the current time, measuring elapsed time, and formatting dates. Together they cover the numerical and temporal needs that come up in many kinds of programs, from scientific calculations to logging timestamps. \ No newline at end of file + +Math functions, from ``, provide operations like square roots, trigonometric functions, and logarithms that go beyond the basic arithmetic operators. Time functions, from ``, handle getting the current time, measuring elapsed time, and formatting dates. Together they cover the numerical and temporal needs that come up in many kinds of programs, from scientific calculations to logging timestamps. + +Visit the following resources to learn more: + +- [@article@C math (math.h) Library](https://www.w3schools.com/c/c_ref_math.php) +- [@article@C Library - \](https://www.tutorialspoint.com/c_standard_library/math_h.htm) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/memory-leakage@6jqJf-byatxy5a0v4cSnF.md b/src/data/roadmaps/c/content/memory-leakage@6jqJf-byatxy5a0v4cSnF.md index 29740aeed..a65264342 100644 --- a/src/data/roadmaps/c/content/memory-leakage@6jqJf-byatxy5a0v4cSnF.md +++ b/src/data/roadmaps/c/content/memory-leakage@6jqJf-byatxy5a0v4cSnF.md @@ -1,3 +1,9 @@ # Memory Leakage - -A memory leak happens when dynamically allocated memory is no longer needed but is never freed, so it stays reserved and unavailable for the rest of the program's execution. Leaks accumulate over time, especially in long-running programs, and can eventually exhaust available memory. Tools like Valgrind can detect leaks by tracking allocations that are never matched with a corresponding `free`. \ No newline at end of file + +A memory leak happens when dynamically allocated memory is no longer needed but is never freed, so it stays reserved and unavailable for the rest of the program's execution. Leaks accumulate over time, especially in long-running programs, and can eventually exhaust available memory. Tools like Valgrind can detect leaks by tracking allocations that are never matched with a corresponding `free`. + +Visit the following resources to learn more: + +- [@article@Finding a Memory Leak in C or C++](https://www.parasoft.com/blog/finding-memory-leaks-in-c-or-c/) +- [@article@How To Find And Fix Memory Leaks in C or C++](https://www.netdata.cloud/academy/how-to-find-memory-leak-in-c/) +- [@video@Memory Leaks And How To Prevent Them](https://www.youtube.com/watch?v=lQCLAKfcYI4) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/memory-model@ICnlPkmGCZiIltmcTRQ6l.md b/src/data/roadmaps/c/content/memory-model@ICnlPkmGCZiIltmcTRQ6l.md index dc46f31d9..62db701af 100644 --- a/src/data/roadmaps/c/content/memory-model@ICnlPkmGCZiIltmcTRQ6l.md +++ b/src/data/roadmaps/c/content/memory-model@ICnlPkmGCZiIltmcTRQ6l.md @@ -1,3 +1,9 @@ # Memory Model - -C's memory model describes how a running program's memory is organized into distinct regions: the stack for local variables and function call information, the heap for dynamically allocated memory, and separate segments for global/static variables and the compiled program code itself. Understanding this layout helps explain why some memory is automatically reclaimed and other memory must be freed manually. It also clarifies why certain bugs, like stack overflows or heap corruption, occur in specific regions. \ No newline at end of file + +C's memory model describes how a running program's memory is organized into distinct regions: the stack for local variables and function call information, the heap for dynamically allocated memory, and separate segments for global/static variables and the compiled program code itself. Understanding this layout helps explain why some memory is automatically reclaimed and other memory must be freed manually. It also clarifies why certain bugs, like stack overflows or heap corruption, occur in specific regions. + +Visit the following resources to learn more: + +- [@article@Memory model](https://en.cppreference.com/c/language/memory_model#:~:text=Defines%20the%20semantics%20of%20computer,memory%20has%20a%20unique%20address.) +- [@article@The C Memory Model](https://www.cs.toronto.edu/~strider//docs/ICS_Chapter_2.pdf) +- [@video@C Programming and Memory Management - Full Course](https://www.youtube.com/watch?v=rJrd2QMVbGM) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/meson@0Dcu1ebOg1BSgZ-G4lhBv.md b/src/data/roadmaps/c/content/meson@0Dcu1ebOg1BSgZ-G4lhBv.md index f3f2171df..965b1658c 100644 --- a/src/data/roadmaps/c/content/meson@0Dcu1ebOg1BSgZ-G4lhBv.md +++ b/src/data/roadmaps/c/content/meson@0Dcu1ebOg1BSgZ-G4lhBv.md @@ -1,3 +1,9 @@ # Meson - -Meson is a build system that emphasizes speed and a simple, readable configuration language, generating backend build files for tools like Ninja rather than compiling directly itself. It aims to make common build tasks straightforward with sensible defaults, reducing the boilerplate often needed with tools like CMake. It has gained adoption in several open-source C projects seeking a more modern build configuration experience. \ No newline at end of file + +Meson is a build system that emphasizes speed and a simple, readable configuration language, generating backend build files for tools like Ninja rather than compiling directly itself. It aims to make common build tasks straightforward with sensible defaults, reducing the boilerplate often needed with tools like CMake. It has gained adoption in several open-source C projects seeking a more modern build configuration experience. + +Visit the following resources to learn more: + +- [@official@Meson Tutorial](https://mesonbuild.com/Tutorial.html) +- [@article@Introduction to meson build system](https://twdev.blog/2022/09/meson/) +- [@video@What is Meson (and Ninja)? \[Build system for C/C++, Rust, and Java\]](https://www.youtube.com/watch?v=A3Pq3E1S8ss) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/mutexes@L3Zaj3-DcM5TSGI_Cx8X2.md b/src/data/roadmaps/c/content/mutexes@L3Zaj3-DcM5TSGI_Cx8X2.md index 3d56995b5..796859943 100644 --- a/src/data/roadmaps/c/content/mutexes@L3Zaj3-DcM5TSGI_Cx8X2.md +++ b/src/data/roadmaps/c/content/mutexes@L3Zaj3-DcM5TSGI_Cx8X2.md @@ -1,3 +1,9 @@ # Mutexes - -A mutex (mutual exclusion lock) is a synchronization primitive that ensures only one thread can access a shared resource, like a variable or data structure, at a time, preventing race conditions. A thread acquires (locks) the mutex before accessing the shared resource and releases (unlocks) it afterward, and any other thread attempting to lock it in the meantime must wait. Forgetting to unlock a mutex, or locking the same mutex twice from the same thread without releasing it first, can cause a program to deadlock, freezing indefinitely. \ No newline at end of file + +A mutex (mutual exclusion lock) is a synchronization primitive that ensures only one thread can access a shared resource, like a variable or data structure, at a time, preventing race conditions. A thread acquires (locks) the mutex before accessing the shared resource and releases (unlocks) it afterward, and any other thread attempting to lock it in the meantime must wait. Forgetting to unlock a mutex, or locking the same mutex twice from the same thread without releasing it first, can cause a program to deadlock, freezing indefinitely. + +Visit the following resources to learn more: + +- [@article@Threads, Mutexes and Concurrent Programming in C](https://www.codequoi.com/en/threads-mutexes-and-concurrent-programming-in-c/) +- [@article@Using mutexes](https://www.ibm.com/docs/en/aix/7.1.0?topic=programming-using-mutexes) +- [@video@Mutex Introduction (pthreads) | C Programming Tutorial](https://www.youtube.com/watch?v=raLCgPK-Igc) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/ninja@clX_lqAyprj2TRxavr68H.md b/src/data/roadmaps/c/content/ninja@clX_lqAyprj2TRxavr68H.md index d0f8e3d34..6d49a5f27 100644 --- a/src/data/roadmaps/c/content/ninja@clX_lqAyprj2TRxavr68H.md +++ b/src/data/roadmaps/c/content/ninja@clX_lqAyprj2TRxavr68H.md @@ -1,3 +1,9 @@ # Ninja - -Ninja is a build system designed to run builds as fast as possible, focusing on quick incremental rebuilds rather than being written directly by hand. Its input files are typically generated by a higher-level tool like CMake rather than authored manually, since Ninja's own file format is intentionally minimal and low-level. It is often chosen as a faster backend for projects that already use CMake to generate their build files. \ No newline at end of file + +Ninja is a build system designed to run builds as fast as possible, focusing on quick incremental rebuilds rather than being written directly by hand. Its input files are typically generated by a higher-level tool like CMake rather than authored manually, since Ninja's own file format is intentionally minimal and low-level. It is often chosen as a faster backend for projects that already use CMake to generate their build files. + +Visit the following resources to learn more: + +- [@official@Ninja](https://ninja-build.org/) +- [@opensource@ninja](https://github.com/ninja-build/ninja) +- [@video@I tried Ninja Build Tool and it changed me...](https://www.youtube.com/watch?v=Z8znH5Grz7I) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/null-pointers@yaYJPKMxWX73mJzRjPCwR.md b/src/data/roadmaps/c/content/null-pointers@yaYJPKMxWX73mJzRjPCwR.md index 0c103e018..5e0ad962e 100644 --- a/src/data/roadmaps/c/content/null-pointers@yaYJPKMxWX73mJzRjPCwR.md +++ b/src/data/roadmaps/c/content/null-pointers@yaYJPKMxWX73mJzRjPCwR.md @@ -1,3 +1,8 @@ # Null Pointers - -A null pointer is a pointer that intentionally points to no valid memory location, conventionally written as `NULL` in C. It is used to indicate that a pointer does not currently reference anything, such as before allocation or after freeing memory. Dereferencing a null pointer is undefined behavior and typically causes a program crash, so checking for `NULL` before use is a common defensive practice. \ No newline at end of file + +A null pointer is a pointer that intentionally points to no valid memory location, conventionally written as `NULL` in C. It is used to indicate that a pointer does not currently reference anything, such as before allocation or after freeing memory. Dereferencing a null pointer is undefined behavior and typically causes a program crash, so checking for `NULL` before use is a common defensive practice. + +Visit the following resources to learn more: + +- [@article@Null pointers in C](https://www.tutorialspoint.com/cprogramming/c_null_pointer.htm) +- [@video@Understanding the Null Pointers](https://www.youtube.com/watch?v=oPScHNQDCkc) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/object-oriented-c@0IFzpiIz7WtNePY65W328.md b/src/data/roadmaps/c/content/object-oriented-c@0IFzpiIz7WtNePY65W328.md index 3a89bcc80..693a407de 100644 --- a/src/data/roadmaps/c/content/object-oriented-c@0IFzpiIz7WtNePY65W328.md +++ b/src/data/roadmaps/c/content/object-oriented-c@0IFzpiIz7WtNePY65W328.md @@ -1,3 +1,9 @@ # Object-Oriented C - -Object-oriented programming techniques can be approximated in C, despite the language having no built-in classes, by combining structs to hold data with function pointers to simulate methods, often organized as a table of function pointers resembling a virtual method table. Encapsulation is typically achieved through opaque pointers, hiding a struct's internal fields from code outside the module that defines it. This style requires more manual discipline than a language with native object-oriented support, but is common in larger C codebases and libraries. \ No newline at end of file + +Object-oriented programming techniques can be approximated in C, despite the language having no built-in classes, by combining structs to hold data with function pointers to simulate methods, often organized as a table of function pointers resembling a virtual method table. Encapsulation is typically achieved through opaque pointers, hiding a struct's internal fields from code outside the module that defines it. This style requires more manual discipline than a language with native object-oriented support, but is common in larger C codebases and libraries. + +Visit the following resources to learn more: + +- [@article@Object-Oriented C: A Primer](https://aartaka.me/oop-c.html) +- [@article@Object-Oriented Programming (OOP) in C](https://www.codementor.io/@michaelsafyan/object-oriented-programming-in-c-du1081gw2) +- [@video@OOP in Pure C](https://www.youtube.com/watch?v=6Riy9hVIFDE) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/opaque-pointers@J_nBnWB5avnvWhGw-_mAZ.md b/src/data/roadmaps/c/content/opaque-pointers@J_nBnWB5avnvWhGw-_mAZ.md index b6d1e6c03..e27e717a7 100644 --- a/src/data/roadmaps/c/content/opaque-pointers@J_nBnWB5avnvWhGw-_mAZ.md +++ b/src/data/roadmaps/c/content/opaque-pointers@J_nBnWB5avnvWhGw-_mAZ.md @@ -1,3 +1,9 @@ # Opaque Pointers - -An opaque pointer is a pointer to a struct whose full definition is hidden from the code using it, typically by only declaring the struct's existence in a header file without listing its members. This lets a library expose functions that operate on the type while keeping its internal fields inaccessible and free to change, achieving a form of encapsulation similar to private members in object-oriented languages. Code using an opaque pointer can only interact with the underlying data through the functions the library provides. \ No newline at end of file + +An opaque pointer is a pointer to a struct whose full definition is hidden from the code using it, typically by only declaring the struct's existence in a header file without listing its members. This lets a library expose functions that operate on the type while keeping its internal fields inaccessible and free to change, achieving a form of encapsulation similar to private members in object-oriented languages. Code using an opaque pointer can only interact with the underlying data through the functions the library provides. + +Visit the following resources to learn more: + +- [@article@Practical Design Patterns: Opaque Pointers and Objects in C](https://interrupt.memfault.com/blog/opaque-pointers) +- [@article@Opaque Data Pointers](https://blog.aaronballman.com/2011/07/opaque-data-pointers/) +- [@video@Make your Data Type more Abstract with Opaque Types in C](https://www.youtube.com/watch?v=TsUOhPsZk6k) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/operators@vDGhrPekat-IYxgUI4NkG.md b/src/data/roadmaps/c/content/operators@vDGhrPekat-IYxgUI4NkG.md index 2e75739a9..fca1b7efd 100644 --- a/src/data/roadmaps/c/content/operators@vDGhrPekat-IYxgUI4NkG.md +++ b/src/data/roadmaps/c/content/operators@vDGhrPekat-IYxgUI4NkG.md @@ -1,3 +1,8 @@ # Operators - -Operators in C are symbols that perform operations on values and variables, such as addition, comparison, or bitwise manipulation. They are grouped into categories including arithmetic, comparison, logical, bitwise, and ternary operators. Each category has its own precedence and associativity rules that determine how expressions with multiple operators are evaluated. \ No newline at end of file + +Operators in C are symbols that perform operations on values and variables, such as addition, comparison, or bitwise manipulation. They are grouped into categories including arithmetic, comparison, logical, bitwise, and ternary operators. Each category has its own precedence and associativity rules that determine how expressions with multiple operators are evaluated. + +Visit the following resources to learn more: + +- [@article@C Operators](https://www.tutorialspoint.com/cprogramming/c_operators.htm) +- [@video@C Operators - C Programming for Beginners](https://www.youtube.com/watch?v=_57FcSBtJNU) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/optimization-levels@2DW9FR0WKWFLT7Hnf5Pyk.md b/src/data/roadmaps/c/content/optimization-levels@2DW9FR0WKWFLT7Hnf5Pyk.md index 40bb168b1..bdbf85512 100644 --- a/src/data/roadmaps/c/content/optimization-levels@2DW9FR0WKWFLT7Hnf5Pyk.md +++ b/src/data/roadmaps/c/content/optimization-levels@2DW9FR0WKWFLT7Hnf5Pyk.md @@ -1,3 +1,9 @@ # Optimization Levels - -Optimization levels, set with compiler flags like `-O0` through `-O3` in GCC and Clang, control how aggressively the compiler transforms code to improve performance, often at the cost of longer compile times and less predictable debugging behavior. `-O0` disables optimization entirely, which is useful during development since the compiled code closely matches the source. Higher levels can reorder, inline, or eliminate code in ways that make step-by-step debugging harder to follow, and can also expose undefined behavior that seemed to work correctly at lower optimization levels. \ No newline at end of file + +Optimization levels, set with compiler flags like `-O0` through `-O3` in GCC and Clang, control how aggressively the compiler transforms code to improve performance, often at the cost of longer compile times and less predictable debugging behavior. `-O0` disables optimization entirely, which is useful during development since the compiled code closely matches the source. Higher levels can reorder, inline, or eliminate code in ways that make step-by-step debugging harder to follow, and can also expose undefined behavior that seemed to work correctly at lower optimization levels. + +Visit the following resources to learn more: + +- [@article@Optimization of Computer Programs in C](https://icps.u-strasbg.fr/~bastoul/local_copies/lee.html) +- [@article@Optimizing compiler](https://en.wikipedia.org/wiki/Optimizing_compiler) +- [@video@C Compiler Optimization Fundamentals](https://www.youtube.com/watch?v=-gZpBCRaEak) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/os--signal-interfaces@USjbDTmKlhwc6Wb0rOPgM.md b/src/data/roadmaps/c/content/os--signal-interfaces@USjbDTmKlhwc6Wb0rOPgM.md index 4c79de4db..e5365ec69 100644 --- a/src/data/roadmaps/c/content/os--signal-interfaces@USjbDTmKlhwc6Wb0rOPgM.md +++ b/src/data/roadmaps/c/content/os--signal-interfaces@USjbDTmKlhwc6Wb0rOPgM.md @@ -1,3 +1,7 @@ # OS & Signal Interfaces - -Operating system and signal interfaces, such as `` and parts of ``, let a C program interact with the underlying operating system, including handling asynchronous events like interrupts (`SIGINT`) or setting up custom responses to system-generated signals. These functions provide a portable, if limited, way to write programs that respond to external events like a user pressing Ctrl+C. More extensive OS interaction, such as process creation, typically requires platform-specific APIs like POSIX functions on Unix-like systems. \ No newline at end of file + +Operating system and signal interfaces, such as `` and parts of ``, let a C program interact with the underlying operating system, including handling asynchronous events like interrupts (`SIGINT`) or setting up custom responses to system-generated signals. These functions provide a portable, if limited, way to write programs that respond to external events like a user pressing Ctrl+C. More extensive OS interaction, such as process creation, typically requires platform-specific APIs like POSIX functions on Unix-like systems. + +Visit the following resources to learn more: + +- [@article@C Library - \](https://www.tutorialspoint.com/c_standard_library/signal_h.htm) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/package-managers@tZtEUp5L9F3He4ZEdN9ph.md b/src/data/roadmaps/c/content/package-managers@tZtEUp5L9F3He4ZEdN9ph.md index 57d5f5b06..57c85c3c3 100644 --- a/src/data/roadmaps/c/content/package-managers@tZtEUp5L9F3He4ZEdN9ph.md +++ b/src/data/roadmaps/c/content/package-managers@tZtEUp5L9F3He4ZEdN9ph.md @@ -1,3 +1,3 @@ # Package Managers - + Package managers for C, such as vcpkg and Conan, automate finding, downloading, and building third-party libraries so they can be linked into a project without manually managing source code or prebuilt binaries. This addresses a longstanding pain point in C development, since the language itself has no built-in package management or standard library distribution mechanism. They typically integrate with build systems like CMake to simplify adding dependencies to a project. \ No newline at end of file diff --git a/src/data/roadmaps/c/content/pointer-arithmetic@HhvKpGZIWo4WUUFIspC8G.md b/src/data/roadmaps/c/content/pointer-arithmetic@HhvKpGZIWo4WUUFIspC8G.md index 53f887504..27849f445 100644 --- a/src/data/roadmaps/c/content/pointer-arithmetic@HhvKpGZIWo4WUUFIspC8G.md +++ b/src/data/roadmaps/c/content/pointer-arithmetic@HhvKpGZIWo4WUUFIspC8G.md @@ -1,3 +1,9 @@ # Pointer Arithmetic - -Pointer arithmetic lets you add or subtract integers from a pointer to move it to a different memory location, with the step size automatically scaled by the size of the type the pointer points to. This is the mechanism behind array indexing, since `arr[i]` is equivalent to `*(arr + i)`. Moving a pointer outside the bounds of the array or object it refers to, then dereferencing it, results in undefined behavior. \ No newline at end of file + +Pointer arithmetic lets you add or subtract integers from a pointer to move it to a different memory location, with the step size automatically scaled by the size of the type the pointer points to. This is the mechanism behind array indexing, since `arr[i]` is equivalent to `*(arr + i)`. Moving a pointer outside the bounds of the array or object it refers to, then dereferencing it, results in undefined behavior. + +Visit the following resources to learn more: + +- [@article@C Pointer Arithmetic](https://www.w3schools.com/c/c_pointers_arithmetic.php) +- [@article@Pointer Arithmetics in C](https://www.tutorialspoint.com/cprogramming/c_pointer_arithmetic.htm) +- [@video@Pointer Arithmetic (Increment & Decrement)](https://www.youtube.com/watch?v=gwqbYnxQGR8) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/pointer-basics--syntax@P0jVQ5M1zMN33pLu7gGb7.md b/src/data/roadmaps/c/content/pointer-basics--syntax@P0jVQ5M1zMN33pLu7gGb7.md index 348eb8def..4e858824c 100644 --- a/src/data/roadmaps/c/content/pointer-basics--syntax@P0jVQ5M1zMN33pLu7gGb7.md +++ b/src/data/roadmaps/c/content/pointer-basics--syntax@P0jVQ5M1zMN33pLu7gGb7.md @@ -1,3 +1,9 @@ # Pointer Basics & Syntax - -A pointer is declared with an asterisk, such as `int *p`, and holds the memory address of a value rather than the value itself. The `&` operator retrieves a variable's address, while the `*` operator, when applied to a pointer, dereferences it to access the value it points to. Pointers are central to C, used for passing large data efficiently, building dynamic data structures, and enabling functions to modify their caller's variables. \ No newline at end of file + +A pointer is declared with an asterisk, such as `int *p`, and holds the memory address of a value rather than the value itself. The `&` operator retrieves a variable's address, while the `*` operator, when applied to a pointer, dereferences it to access the value it points to. Pointers are central to C, used for passing large data efficiently, building dynamic data structures, and enabling functions to modify their caller's variables. + +Visit the following resources to learn more: + +- [@course@Learn Pointers](https://www.learn-c.org/en/Pointers) +- [@article@Pointers in C](https://www.tutorialspoint.com/cprogramming/c_pointers.htm) +- [@video@Pointers in C / C++ \[Full Course\]](https://www.youtube.com/watch?v=zuegQmMdy8M) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/pointers--memory@M6WIUp-bxgRRmpwcJ_doe.md b/src/data/roadmaps/c/content/pointers--memory@M6WIUp-bxgRRmpwcJ_doe.md index c01a9671c..8a5e565c9 100644 --- a/src/data/roadmaps/c/content/pointers--memory@M6WIUp-bxgRRmpwcJ_doe.md +++ b/src/data/roadmaps/c/content/pointers--memory@M6WIUp-bxgRRmpwcJ_doe.md @@ -1,3 +1,10 @@ # Pointers & Memory - -Pointers and memory concepts cover how C represents and manages memory directly, rather than hiding it behind automatic garbage collection. A pointer is a variable that stores the memory address of another value, giving direct access to and control over memory. This area also covers the layout of a program's memory, the difference between stack and heap allocation, and the risks of managing memory manually, like leaks and dangling pointers. \ No newline at end of file + +Pointers and memory concepts cover how C represents and manages memory directly, rather than hiding it behind automatic garbage collection. A pointer is a variable that stores the memory address of another value, giving direct access to and control over memory. This area also covers the layout of a program's memory, the difference between stack and heap allocation, and the risks of managing memory manually, like leaks and dangling pointers. + +Visit the following resources to learn more: + +- [@course@Pointers](https://www.learn-c.org/en/Pointers) +- [@article@C pointers](http://tutorialspoint.com/cprogramming/c_pointers.htm) +- [@video@Pointers: you will never ask about pointers again after watching this video](https://www.youtube.com/watch?v=2ybLD6_2gKM&t=438s) +- [@video@C pointers explained👉](https://www.youtube.com/watch?v=DplxIq0mc_Y) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/posix-threads@taWuoFSGTYRHcMRoaHz2U.md b/src/data/roadmaps/c/content/posix-threads@taWuoFSGTYRHcMRoaHz2U.md index 402b5e1c6..41492b67d 100644 --- a/src/data/roadmaps/c/content/posix-threads@taWuoFSGTYRHcMRoaHz2U.md +++ b/src/data/roadmaps/c/content/posix-threads@taWuoFSGTYRHcMRoaHz2U.md @@ -1,3 +1,9 @@ # POSIX Threads - -POSIX Threads, commonly called pthreads, is a standardized API, defined in ``, for creating and managing threads on Unix-like systems, letting a single process run multiple sequences of instructions concurrently. Threads created this way share the same memory space, which enables fast communication between them but also introduces the risk of race conditions when multiple threads access the same data without coordination. Functions like `pthread_create` and `pthread_join` handle starting new threads and waiting for them to finish. \ No newline at end of file + +POSIX Threads, commonly called pthreads, is a standardized API, defined in ``, for creating and managing threads on Unix-like systems, letting a single process run multiple sequences of instructions concurrently. Threads created this way share the same memory space, which enables fast communication between them but also introduces the risk of race conditions when multiple threads access the same data without coordination. Functions like `pthread_create` and `pthread_join` handle starting new threads and waiting for them to finish. + +Visit the following resources to learn more: + +- [@article@POSIX thread (pthread) libraries](https://www.cs.cmu.edu/afs/cs/academic/class/15492-f07/www/pthreads.html) +- [@article@POSIX Threads (pthreads) — The Simplest Way to Understand Real Multithreading in C](https://medium.com/@techdhaba.training/posix-threads-pthreads-the-simplest-way-to-understand-real-multithreading-in-c-c2f591ab7a03) +- [@video@How to create and join threads in C (pthreads).](https://www.youtube.com/watch?v=uA8X5zNOGw8) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/predefined-macros@I7Bu9qv6H3znapVwxpZtK.md b/src/data/roadmaps/c/content/predefined-macros@I7Bu9qv6H3znapVwxpZtK.md index 0dbfc26e3..f8a3d8f6e 100644 --- a/src/data/roadmaps/c/content/predefined-macros@I7Bu9qv6H3znapVwxpZtK.md +++ b/src/data/roadmaps/c/content/predefined-macros@I7Bu9qv6H3znapVwxpZtK.md @@ -1,3 +1,8 @@ # Predefined Macros - -Predefined macros are macros that the compiler defines automatically without any explicit `#define`, providing information such as the current file name (`__FILE__`), line number (`__LINE__`), compilation date (`__DATE__`), or which C standard is in use (`__STDC_VERSION__`). They are often used in debugging output or conditional compilation to adapt code based on the compiler or platform. Different compilers may also define their own additional predefined macros beyond the standard set. \ No newline at end of file + +Predefined macros are macros that the compiler defines automatically without any explicit `#define`, providing information such as the current file name (`__FILE__`), line number (`__LINE__`), compilation date (`__DATE__`), or which C standard is in use (`__STDC_VERSION__`). They are often used in debugging output or conditional compilation to adapt code based on the compiler or platform. Different compilers may also define their own additional predefined macros beyond the standard set. + +Visit the following resources to learn more: + +- [@article@Predefined macros](https://developer.arm.com/documentation/dui0282/b/arm-compiler-reference/predefined-macros) +- [@video@Predefined Preprocessor Macros + Log File Use Case](https://www.youtube.com/watch?v=vIy0vEZpjtQ) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/preprocessors@H8LI-74sxAjukEbqhqvXZ.md b/src/data/roadmaps/c/content/preprocessors@H8LI-74sxAjukEbqhqvXZ.md index 2d2738087..33a7ad8e6 100644 --- a/src/data/roadmaps/c/content/preprocessors@H8LI-74sxAjukEbqhqvXZ.md +++ b/src/data/roadmaps/c/content/preprocessors@H8LI-74sxAjukEbqhqvXZ.md @@ -1,3 +1,9 @@ # Preprocessors - -The preprocessor runs before actual compilation begins, handling directives that start with `#`, such as `#include`, `#define`, and conditional compilation directives. It performs purely textual transformations on the source code, expanding macros and including header file contents, before the compiler ever sees the result. Understanding preprocessor behavior helps explain why macro-related bugs can be tricky, since errors often point to the expanded code rather than the original macro invocation. \ No newline at end of file + +The preprocessor runs before actual compilation begins, handling directives that start with `#`, such as `#include`, `#define`, and conditional compilation directives. It performs purely textual transformations on the source code, expanding macros and including header file contents, before the compiler ever sees the result. Understanding preprocessor behavior helps explain why macro-related bugs can be tricky, since errors often point to the expanded code rather than the original macro invocation. + +Visit the following resources to learn more: + +- [@article@C Preprocessor and Macros](https://www.w3schools.com/c/c_macros.php) +- [@article@Preprocessors in C](https://www.tutorialspoint.com/cprogramming/c_preprocessors.htm) +- [@article@Preprocessor](https://cppreference.com/c/preprocessor) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/printing-variables@yciCL88miyxj5edEy2ZLH.md b/src/data/roadmaps/c/content/printing-variables@yciCL88miyxj5edEy2ZLH.md index c97d45e4f..19774de6d 100644 --- a/src/data/roadmaps/c/content/printing-variables@yciCL88miyxj5edEy2ZLH.md +++ b/src/data/roadmaps/c/content/printing-variables@yciCL88miyxj5edEy2ZLH.md @@ -1,3 +1,9 @@ # Printing Variables - -Printing variables in C typically uses the `printf` function from the standard library, with format specifiers like `%d` for integers, `%f` for floats, or `%s` for strings telling it how to interpret the data. Each specifier must match the variable's actual type, since `printf` does not check this at compile time and mismatches can produce garbage output or crashes. This makes printing a common source of subtle bugs for beginners. \ No newline at end of file + +Printing variables in C typically uses the `printf` function from the standard library, with format specifiers like `%d` for integers, `%f` for floats, or `%s` for strings telling it how to interpret the data. Each specifier must match the variable's actual type, since `printf` does not check this at compile time and mismatches can produce garbage output or crashes. This makes printing a common source of subtle bugs for beginners. + +Visit the following resources to learn more: + +- [@article@C Output (Print Text)](https://www.w3schools.com/c/c_output.php) +- [@article@printf() Function in C](https://www.tutorialspoint.com/cprogramming/c_printf_function.htm) +- [@video@printf Basics | C Programming Tutorial](https://www.youtube.com/watch?v=ycKZKDCMMzM) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/process-management@xr2VDNyz4LdRSnuUHa6SI.md b/src/data/roadmaps/c/content/process-management@xr2VDNyz4LdRSnuUHa6SI.md index a5a0b84f8..a3c2fef39 100644 --- a/src/data/roadmaps/c/content/process-management@xr2VDNyz4LdRSnuUHa6SI.md +++ b/src/data/roadmaps/c/content/process-management@xr2VDNyz4LdRSnuUHa6SI.md @@ -1,3 +1,9 @@ # Process Management - -Process management covers creating, controlling, and terminating processes from within a C program, typically using POSIX functions like `fork` to create a new process, `exec` to replace a process's program with a new one, and `wait` to have a parent process wait for a child process to finish. This is the foundation for how shells and other programs launch and manage other programs. It is closely related to but distinct from concurrency, since separate processes have their own independent memory space unlike threads. \ No newline at end of file + +Process management covers creating, controlling, and terminating processes from within a C program, typically using POSIX functions like `fork` to create a new process, `exec` to replace a process's program with a new one, and `wait` to have a parent process wait for a child process to finish. This is the foundation for how shells and other programs launch and manage other programs. It is closely related to but distinct from concurrency, since separate processes have their own independent memory space unlike threads. + +Visit the following resources to learn more: + +- [@article@Process Management: Operating System](https://dev.to/harshm03/process-management-operating-system-18gl) +- [@article@Mastering fork() and exec() in C: The Complete Beginner’s Guide to Process Management in Unix-like Systems](https://levelup.gitconnected.com/mastering-fork-and-exec-in-c-a-beginners-guide-to-process-management-in-unix-like-operating-81b2b19b4dfe) +- [@video@Process Management (Processes and Threads)](https://www.youtube.com/watch?v=OrM7nZcxXZU) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/raii-simulated-cleanup@TnMlP8w8Fl8oF5Z-GI5Sv.md b/src/data/roadmaps/c/content/raii-simulated-cleanup@TnMlP8w8Fl8oF5Z-GI5Sv.md index 0f46c7310..41f0b0663 100644 --- a/src/data/roadmaps/c/content/raii-simulated-cleanup@TnMlP8w8Fl8oF5Z-GI5Sv.md +++ b/src/data/roadmaps/c/content/raii-simulated-cleanup@TnMlP8w8Fl8oF5Z-GI5Sv.md @@ -1,3 +1,7 @@ # RAII-Simulated Cleanup - -RAII (Resource Acquisition Is Initialization) is a pattern from C++ where a resource's cleanup is tied automatically to an object's lifetime. C has no destructors to do this automatically, so similar cleanup guarantees are simulated manually, for example using the `goto` statement to jump to a single cleanup section at the end of a function that frees all acquired resources. Some compilers also support a non-standard `__attribute__((cleanup))` extension that calls a specified function automatically when a variable goes out of scope. Both approaches aim to reduce the risk of forgetting to release a resource on one of several possible exit paths from a function. \ No newline at end of file + +RAII (Resource Acquisition Is Initialization) is a pattern from C++ where a resource's cleanup is tied automatically to an object's lifetime. C has no destructors to do this automatically, so similar cleanup guarantees are simulated manually, for example using the `goto` statement to jump to a single cleanup section at the end of a function that frees all acquired resources. Some compilers also support a non-standard `__attribute__((cleanup))` extension that calls a specified function automatically when a variable goes out of scope. Both approaches aim to reduce the risk of forgetting to release a resource on one of several possible exit paths from a function. + +Visit the following resources to learn more: + +- [@article@RAII in C: Automating Resource Management with GCC Attributes](https://dev.to/ayush_saini/raii-in-c-automating-resource-management-with-gcc-attributes-3cgf) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/realloc@u_afM2pvFeKARfplmbjP0.md b/src/data/roadmaps/c/content/realloc@u_afM2pvFeKARfplmbjP0.md new file mode 100644 index 000000000..30347b0c3 --- /dev/null +++ b/src/data/roadmaps/c/content/realloc@u_afM2pvFeKARfplmbjP0.md @@ -0,0 +1,9 @@ +# realloc + +`realloc` is a function used to change the size of a previously allocated memory block. It takes a pointer to an existing memory block and a new size as arguments, then attempts to resize the block while preserving its existing contents. If the current memory location cannot be expanded, it allocates a new block of the requested size, copies the data from the old memory to the new location, frees the old memory, and returns a pointer to the new block. + +Visit the following resources to learn more: + +- [@article@C Reallocate Memory](https://www.w3schools.com/c/c_memory_reallocate.php) +- [@article@C library - realloc() function](https://www.tutorialspoint.com/c_standard_library/c_function_realloc.htm) +- [@video@Realloc in C explained easy! 🚢](https://www.youtube.com/watch?v=rUXjvybSPWc) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/recursive-functions@LfkNE6HzPxfeq9WP0TB0K.md b/src/data/roadmaps/c/content/recursive-functions@LfkNE6HzPxfeq9WP0TB0K.md index 327634503..0d181c625 100644 --- a/src/data/roadmaps/c/content/recursive-functions@LfkNE6HzPxfeq9WP0TB0K.md +++ b/src/data/roadmaps/c/content/recursive-functions@LfkNE6HzPxfeq9WP0TB0K.md @@ -1,3 +1,8 @@ # Recursive Functions - -A recursive function is one that calls itself, either directly or indirectly, to solve a problem by breaking it into smaller instances of the same problem. Every recursive function needs a base case that stops the recursion, otherwise it will call itself indefinitely until it exhausts the call stack. Recursion is well suited to problems with a naturally recursive structure, like tree traversal, though it can use more memory than an equivalent loop due to the accumulating function calls on the stack. \ No newline at end of file + +A recursive function is one that calls itself, either directly or indirectly, to solve a problem by breaking it into smaller instances of the same problem. Every recursive function needs a base case that stops the recursion, otherwise it will call itself indefinitely until it exhausts the call stack. Recursion is well suited to problems with a naturally recursive structure, like tree traversal, though it can use more memory than an equivalent loop due to the accumulating function calls on the stack. + +Visit the following resources to learn more: + +- [@article@C Recursion](https://www.tutorialspoint.com/cprogramming/c_recursion.htm) +- [@video@Recursion in C](https://www.youtube.com/watch?v=kepBmgvWNDw) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/restrict@Fmop70stlzRvvf7ozgohF.md b/src/data/roadmaps/c/content/restrict@Fmop70stlzRvvf7ozgohF.md index fdeec50f2..ca9905ff4 100644 --- a/src/data/roadmaps/c/content/restrict@Fmop70stlzRvvf7ozgohF.md +++ b/src/data/roadmaps/c/content/restrict@Fmop70stlzRvvf7ozgohF.md @@ -1,3 +1,8 @@ # restrict - -The `restrict` qualifier, introduced in C99, is a hint to the compiler that a pointer is the only way to access the memory it points to during its lifetime. This allows the compiler to make more aggressive optimizations, since it does not need to guard against another pointer aliasing the same memory. Misusing `restrict` by actually aliasing the memory anyway results in undefined behavior. \ No newline at end of file + +The `restrict` qualifier, introduced in C99, is a hint to the compiler that a pointer is the only way to access the memory it points to during its lifetime. This allows the compiler to make more aggressive optimizations, since it does not need to guard against another pointer aliasing the same memory. Misusing `restrict` by actually aliasing the memory anyway results in undefined behavior. + +Visit the following resources to learn more: + +- [@article@restrict type qualifier](https://en.cppreference.com/c/language/restrict) +- [@video@The ONLY C keyword with no C++ equivalent](https://www.youtube.com/watch?v=TBGu3NNpF1Q&t=58s) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/ring-buffers--fifo-queues@a5vmstRQ2nH0-o3fn_vJP.md b/src/data/roadmaps/c/content/ring-buffers--fifo-queues@a5vmstRQ2nH0-o3fn_vJP.md index 2bc6d8ee3..e44d16623 100644 --- a/src/data/roadmaps/c/content/ring-buffers--fifo-queues@a5vmstRQ2nH0-o3fn_vJP.md +++ b/src/data/roadmaps/c/content/ring-buffers--fifo-queues@a5vmstRQ2nH0-o3fn_vJP.md @@ -1,3 +1,8 @@ # Ring Buffers / FIFO Queues - -A ring buffer, or circular buffer, is a fixed-size buffer that wraps around to the beginning once it reaches the end, making it efficient for implementing first-in-first-out queues without shifting elements. It tracks a read position and a write position that both wrap around the buffer's length. Ring buffers are common in embedded systems and streaming applications where data arrives continuously and memory needs to stay bounded. \ No newline at end of file + +A ring buffer, or circular buffer, is a fixed-size buffer that wraps around to the beginning once it reaches the end, making it efficient for implementing first-in-first-out queues without shifting elements. It tracks a read position and a write position that both wrap around the buffer's length. Ring buffers are common in embedded systems and streaming applications where data arrives continuously and memory needs to stay bounded. + +Visit the following resources to learn more: + +- [@article@Creating a Circular Buffer in C and C++](https://embeddedartistry.com/blog/2017/05/17/creating-a-circular-buffer-in-c-and-c/) +- [@video@Circular Buffer | Circular Buffer Implementation in C](https://www.youtube.com/watch?v=uvD9_Wdtjtw) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/running-your-first-program@38JQAsASLIbzZ_lzsTesM.md b/src/data/roadmaps/c/content/running-your-first-program@38JQAsASLIbzZ_lzsTesM.md index 8cbe412b1..3e96d3557 100644 --- a/src/data/roadmaps/c/content/running-your-first-program@38JQAsASLIbzZ_lzsTesM.md +++ b/src/data/roadmaps/c/content/running-your-first-program@38JQAsASLIbzZ_lzsTesM.md @@ -1,3 +1,10 @@ # Running your First Program - -Running a first C program means writing a small source file, usually one that prints "Hello, World!", compiling it with a tool like GCC, and executing the resulting binary. This process introduces the basic compile-then-run workflow that every C program follows: source code goes through the compiler to produce machine code, and only that machine code actually runs. It is a good checkpoint to confirm the toolchain from installation works correctly. \ No newline at end of file + +Running a first C program means writing a small source file, usually one that prints "Hello, World!", compiling it with a tool like GCC, and executing the resulting binary. This process introduces the basic compile-then-run workflow that every C program follows: source code goes through the compiler to produce machine code, and only that machine code actually runs. It is a good checkpoint to confirm the toolchain from installation works correctly. + +Visit the following resources to learn more: + +- [@article@C - Program Structure](https://www.tutorialspoint.com/cprogramming/c_program_structure.htm) +- [@article@C - Hello World](https://www.tutorialspoint.com/cprogramming/c_hello_world.htm) +- [@article@Your First Program in C (For Windows Users)](https://www.instructables.com/Your-first-program-in-C-For-Windows-users/) +- [@video@Start C programming in 15 minutes! ⚙️](https://www.youtube.com/watch?v=2ciUcosJFBc) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/setjmp--longjmp@uu93EX_9ZcYY8_3O7H_PI.md b/src/data/roadmaps/c/content/setjmp--longjmp@uu93EX_9ZcYY8_3O7H_PI.md index 07cbc0db9..cc22463be 100644 --- a/src/data/roadmaps/c/content/setjmp--longjmp@uu93EX_9ZcYY8_3O7H_PI.md +++ b/src/data/roadmaps/c/content/setjmp--longjmp@uu93EX_9ZcYY8_3O7H_PI.md @@ -1,3 +1,8 @@ # setjmp / longjmp - -`setjmp` and `longjmp`, declared in ``, implement a non-local jump that lets a program save an execution point with `setjmp` and later jump back to it with `longjmp`, potentially unwinding several function calls at once. This is sometimes used as a rough substitute for exception handling, for example to recover from an error deep in a call stack. Because it skips normal function cleanup, like calling destructors in C++, it must be used carefully, and it does not exist to make error handling elegant, only possible. \ No newline at end of file + +`setjmp` and `longjmp`, declared in ``, implement a non-local jump that lets a program save an execution point with `setjmp` and later jump back to it with `longjmp`, potentially unwinding several function calls at once. This is sometimes used as a rough substitute for exception handling, for example to recover from an error deep in a call stack. Because it skips normal function cleanup, like calling destructors in C++, it must be used carefully, and it does not exist to make error handling elegant, only possible. + +Visit the following resources to learn more: + +- [@article@setjmp(), longjmp(), and Exception Handling in C](https://dev.to/pauljlucas/setjmp-longjmp-and-exception-handling-in-c-1h7h) +- [@video@Can I Handle Exceptions with Try Catch in C? (setjmp, longjmp)](https://www.youtube.com/watch?v=eQcRcgOnl9o) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/setting-up@UTX0BspDuWe4UXAjXWFxi.md b/src/data/roadmaps/c/content/setting-up@UTX0BspDuWe4UXAjXWFxi.md index b0cb376af..04374a6d9 100644 --- a/src/data/roadmaps/c/content/setting-up@UTX0BspDuWe4UXAjXWFxi.md +++ b/src/data/roadmaps/c/content/setting-up@UTX0BspDuWe4UXAjXWFxi.md @@ -1,3 +1,9 @@ # Setting up - -Setting up C means installing a compiler, choosing an editor, and confirming that a simple program builds and runs on the local machine. The exact steps differ by operating system, since Linux and macOS often ship with a compiler already available while Windows usually requires a separate install. Getting this working correctly at the start avoids confusion later when debugging build errors. \ No newline at end of file + +Setting up C means installing a compiler, choosing an editor, and confirming that a simple program builds and runs on the local machine. The exact steps differ by operating system, since Linux and macOS often ship with a compiler already available while Windows usually requires a separate install. Getting this working correctly at the start avoids confusion later when debugging build errors. + +Visit the following resources to learn more: + +- [@article@C Get Started](https://www.w3schools.com/c/c_getstarted.php) +- [@article@C - Environment Setup](http://tutorialspoint.com/cprogramming/c_environment_setup.htm) +- [@video@Start C programming in 15 minutes! ⚙️](https://www.youtube.com/watch?v=2ciUcosJFBc) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/stack-vs-heap@4RHp4jaQ24quGah_-GzKo.md b/src/data/roadmaps/c/content/stack-vs-heap@4RHp4jaQ24quGah_-GzKo.md index db8eafc4b..4b9724892 100644 --- a/src/data/roadmaps/c/content/stack-vs-heap@4RHp4jaQ24quGah_-GzKo.md +++ b/src/data/roadmaps/c/content/stack-vs-heap@4RHp4jaQ24quGah_-GzKo.md @@ -1,3 +1,9 @@ # Stack vs Heap - -The stack is a region of memory that automatically manages local variables and function call data, growing and shrinking as functions are called and return, and it is fast but limited in size. The heap is a region for dynamically allocated memory, managed manually with functions like `malloc` and `free`, offering more flexibility in size and lifetime at the cost of more responsibility. Choosing between them depends on whether the data's size is known at compile time and how long it needs to live. \ No newline at end of file + +The stack is a region of memory that automatically manages local variables and function call data, growing and shrinking as functions are called and return, and it is fast but limited in size. The heap is a region for dynamically allocated memory, managed manually with functions like `malloc` and `free`, offering more flexibility in size and lifetime at the cost of more responsibility. Choosing between them depends on whether the data's size is known at compile time and how long it needs to live. + +Visit the following resources to learn more: + +- [@article@Stack and Heap](https://medium.com/@beingnile/stack-and-heap-25ada76c1b61) +- [@article@What are Stack and Heap Memory?](https://www.youtube.com/watch?v=ep2xOW52mDY) +- [@video@How to Implement a Stack in C With Code Examples](https://www.digitalocean.com/community/tutorials/stack-in-c) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/standard-library@K0a40UVhxnybYUWPCpHYh.md b/src/data/roadmaps/c/content/standard-library@K0a40UVhxnybYUWPCpHYh.md index 554e1fe53..0359dcb6a 100644 --- a/src/data/roadmaps/c/content/standard-library@K0a40UVhxnybYUWPCpHYh.md +++ b/src/data/roadmaps/c/content/standard-library@K0a40UVhxnybYUWPCpHYh.md @@ -1,3 +1,3 @@ # Standard Library - + The C standard library is a collection of functions and macros, grouped into headers like `` and ``, that come bundled with every standards-compliant C compiler. It covers common needs such as input/output, string handling, memory allocation, math functions, and time handling, so programmers do not need to reimplement basic functionality themselves. Its scope is deliberately limited compared to standard libraries in some other languages, reflecting C's minimalist design. \ No newline at end of file diff --git a/src/data/roadmaps/c/content/static@2XSFrsw3uSrAry5zJ3MV9.md b/src/data/roadmaps/c/content/static@2XSFrsw3uSrAry5zJ3MV9.md index 4d0336bb8..37bc5e8d5 100644 --- a/src/data/roadmaps/c/content/static@2XSFrsw3uSrAry5zJ3MV9.md +++ b/src/data/roadmaps/c/content/static@2XSFrsw3uSrAry5zJ3MV9.md @@ -1,3 +1,8 @@ # static - -At file scope, `static` gives a variable or function internal linkage, restricting its visibility to the file it is defined in and preventing naming conflicts with other files. Inside a function, `static` on a local variable makes it retain its value between function calls instead of being reinitialized each time, while still keeping it local to that function. These two uses of `static` control different things, visibility versus lifetime, depending on where the keyword appears. \ No newline at end of file + +At file scope, `static` gives a variable or function internal linkage, restricting its visibility to the file it is defined in and preventing naming conflicts with other files. Inside a function, `static` on a local variable makes it retain its value between function calls instead of being reinitialized each time, while still keeping it local to that function. These two uses of `static` control different things, visibility versus lifetime, depending on where the keyword appears. + +Visit the following resources to learn more: + +- [@article@C static Keyword](https://www.w3schools.com/c/ref_keyword_static.php) +- [@video@The Static Keyword in C](https://www.youtube.com/watch?v=3E-r4GfvWOI) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/strace@VVJk4mqpurVbduRfeMh5Z.md b/src/data/roadmaps/c/content/strace@VVJk4mqpurVbduRfeMh5Z.md index 176d17de5..4fba2759e 100644 --- a/src/data/roadmaps/c/content/strace@VVJk4mqpurVbduRfeMh5Z.md +++ b/src/data/roadmaps/c/content/strace@VVJk4mqpurVbduRfeMh5Z.md @@ -1,3 +1,8 @@ # strace - -strace is a Linux diagnostic tool that traces and logs the system calls a running program makes to the operating system kernel, such as opening files, reading input, or allocating memory. It helps diagnose problems related to file access, permissions, or unexpected system-level behavior without needing to modify or recompile the program being examined. Because it operates at the system call level, it is especially useful for debugging issues outside the program's own source code, like missing files or failed permissions. \ No newline at end of file + +strace is a Linux diagnostic tool that traces and logs the system calls a running program makes to the operating system kernel, such as opening files, reading input, or allocating memory. It helps diagnose problems related to file access, permissions, or unexpected system-level behavior without needing to modify or recompile the program being examined. Because it operates at the system call level, it is especially useful for debugging issues outside the program's own source code, like missing files or failed permissions. + +Visit the following resources to learn more: + +- [@article@strace Command in Linux](https://www.tutorialspoint.com/unix_commands/strace.htm) +- [@video@Spying on Running Programs (strace, ltrace, system calls vs function calls)](https://www.youtube.com/watch?v=2AmP7Pse4U0) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/streams@GhgPLOX53uRMueGKnoAch.md b/src/data/roadmaps/c/content/streams@GhgPLOX53uRMueGKnoAch.md index 2c51e0dc6..dc920c7e6 100644 --- a/src/data/roadmaps/c/content/streams@GhgPLOX53uRMueGKnoAch.md +++ b/src/data/roadmaps/c/content/streams@GhgPLOX53uRMueGKnoAch.md @@ -1,3 +1,7 @@ # Streams - -A stream in C is an abstraction representing a source or destination of data, such as a file, the keyboard, or the screen, accessed through a `FILE *` pointer. The standard library provides three streams automatically: `stdin` for input, `stdout` for normal output, and `stderr` for error output. Functions like `fopen`, `fread`, `fwrite`, and `fclose` operate on streams rather than directly on the underlying file descriptor. \ No newline at end of file + +A stream in C is an abstraction representing a source or destination of data, such as a file, the keyboard, or the screen, accessed through a `FILE *` pointer. The standard library provides three streams automatically: `stdin` for input, `stdout` for normal output, and `stderr` for error output. Functions like `fopen`, `fread`, `fwrite`, and `fclose` operate on streams rather than directly on the underlying file descriptor. + +Visit the following resources to learn more: + +- [@article@C programming/Stream IO](https://en.wikibooks.org/wiki/C_programming/Stream_IO) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/strings@-NvNwB58TkSdPfGg7OhqK.md b/src/data/roadmaps/c/content/strings@-NvNwB58TkSdPfGg7OhqK.md index af77b2c8e..5d99241e4 100644 --- a/src/data/roadmaps/c/content/strings@-NvNwB58TkSdPfGg7OhqK.md +++ b/src/data/roadmaps/c/content/strings@-NvNwB58TkSdPfGg7OhqK.md @@ -1,3 +1,10 @@ # Strings - -C represents strings as arrays of `char` terminated by a null character (`\0`), rather than as a distinct string type. Because of this, string handling relies on knowing exactly where the null terminator is, and functions like `strlen`, `strcpy`, and `strcmp` from `` operate on this convention. Forgetting to account for the null terminator's extra byte, or copying a string into a buffer too small to hold it, are frequent sources of bugs. \ No newline at end of file + +C represents strings as arrays of `char` terminated by a null character (`\0`), rather than as a distinct string type. Because of this, string handling relies on knowing exactly where the null terminator is, and functions like `strlen`, `strcpy`, and `strcmp` from `` operate on this convention. Forgetting to account for the null terminator's extra byte, or copying a string into a buffer too small to hold it, are frequent sources of bugs. + +Visit the following resources to learn more: + +- [@article@C Strings](https://www.w3schools.com/c/c_strings.php) +- [@article@C/Strings](https://www.cs.yale.edu/homes/aspnes/pinewiki/C(2f)Strings.html) +- [@video@String Basics | C Programming Tutorial](https://www.youtube.com/watch?v=60OI5tzmkCw) +- [@video@String In Char Array VS. Pointer To String Literal](https://www.youtube.com/watch?v=Qp3WatLL_Hc) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/structs@CD-aDJ-oAjtf2RgxQDlZ2.md b/src/data/roadmaps/c/content/structs@CD-aDJ-oAjtf2RgxQDlZ2.md index 51e953685..1219a971d 100644 --- a/src/data/roadmaps/c/content/structs@CD-aDJ-oAjtf2RgxQDlZ2.md +++ b/src/data/roadmaps/c/content/structs@CD-aDJ-oAjtf2RgxQDlZ2.md @@ -1,3 +1,9 @@ # Structs - -A `struct` groups multiple variables, possibly of different types, under a single name, so related data can be treated as one unit. Each field, or member, is accessed using the dot operator, or the arrow operator if accessed through a pointer to the struct. Structs are the primary way C models compound data, from simple pairs of values to complex records used in larger data structures. \ No newline at end of file + +A `struct` groups multiple variables, possibly of different types, under a single name, so related data can be treated as one unit. Each field, or member, is accessed using the dot operator, or the arrow operator if accessed through a pointer to the struct. Structs are the primary way C models compound data, from simple pairs of values to complex records used in larger data structures. + +Visit the following resources to learn more: + +- [@article@C Structures (structs)](https://www.w3schools.com/c/c_structs.php) +- [@article@Struct declaration](https://en.cppreference.com/c/language/struct) +- [@video@C structs 🏠](https://www.youtube.com/watch?v=oKXP1HZ8xIs) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/structuring-codebase@dlIC0Hb7fHPgNeFiyYk8V.md b/src/data/roadmaps/c/content/structuring-codebase@dlIC0Hb7fHPgNeFiyYk8V.md index f0d9914d2..3bbe23f5d 100644 --- a/src/data/roadmaps/c/content/structuring-codebase@dlIC0Hb7fHPgNeFiyYk8V.md +++ b/src/data/roadmaps/c/content/structuring-codebase@dlIC0Hb7fHPgNeFiyYk8V.md @@ -1,3 +1,3 @@ # Structuring Codebase - + Structuring a C codebase covers how to organize code across multiple files as a project grows beyond a single source file. This includes splitting declarations into header files, controlling which variables and functions are visible outside a file using linkage, and understanding how storage duration affects a variable's lifetime. Good structure keeps large C projects maintainable and avoids naming conflicts between files. \ No newline at end of file diff --git a/src/data/roadmaps/c/content/symbol-tables@kKbEUfG7emh2a_t0W8iwa.md b/src/data/roadmaps/c/content/symbol-tables@kKbEUfG7emh2a_t0W8iwa.md index ab0a375cc..4592b1c22 100644 --- a/src/data/roadmaps/c/content/symbol-tables@kKbEUfG7emh2a_t0W8iwa.md +++ b/src/data/roadmaps/c/content/symbol-tables@kKbEUfG7emh2a_t0W8iwa.md @@ -1,3 +1,8 @@ # Symbol Tables - -A symbol table is a data structure maintained during compilation and linking that maps names, like function and variable identifiers, to information such as their memory addresses or types. Compilers use it internally to resolve references within a single file, while linkers use symbol tables to connect references across multiple object files. Tools like `nm` can inspect the symbol table of a compiled object file to see what names it defines or requires. \ No newline at end of file + +A symbol table is a data structure maintained during compilation and linking that maps names, like function and variable identifiers, to information such as their memory addresses or types. Compilers use it internally to resolve references within a single file, while linkers use symbol tables to connect references across multiple object files. Tools like `nm` can inspect the symbol table of a compiled object file to see what names it defines or requires. + +Visit the following resources to learn more: + +- [@article@Symbol Tables - Wikipedia](https://en.wikipedia.org/wiki/Symbol_table) +- [@video@Symbol Table](https://www.youtube.com/watch?v=Dd3DWRpqI40&t=95s) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/ternary@Kz8gzwxvKQz5UuB3_EJLc.md b/src/data/roadmaps/c/content/ternary@Kz8gzwxvKQz5UuB3_EJLc.md index 9a3b2c789..f56e888b9 100644 --- a/src/data/roadmaps/c/content/ternary@Kz8gzwxvKQz5UuB3_EJLc.md +++ b/src/data/roadmaps/c/content/ternary@Kz8gzwxvKQz5UuB3_EJLc.md @@ -1,3 +1,8 @@ # Ternary - -The ternary operator, written as `condition ? value_if_true : value_if_false`, is a compact way to write a simple if-else expression that returns a value. It is the only operator in C that takes three operands. Overusing it for complex conditions can hurt readability, so it works best for short, simple choices. \ No newline at end of file + +The ternary operator, written as `condition ? value_if_true : value_if_false`, is a compact way to write a simple if-else expression that returns a value. It is the only operator in C that takes three operands. Overusing it for complex conditions can hurt readability, so it works best for short, simple choices. + +Visit the following resources to learn more: + +- [@article@Ternary Operator in C](https://www.tutorialspoint.com/cprogramming/c_ternary_operator.htm) +- [@video@Ternary Operator in C |](https://www.youtube.com/watch?v=05xv2nMj6Ls) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/testing@cgYsOE6XhfnTYEgDQh3o-.md b/src/data/roadmaps/c/content/testing@cgYsOE6XhfnTYEgDQh3o-.md index b28c21cb4..9305a15a0 100644 --- a/src/data/roadmaps/c/content/testing@cgYsOE6XhfnTYEgDQh3o-.md +++ b/src/data/roadmaps/c/content/testing@cgYsOE6XhfnTYEgDQh3o-.md @@ -1,3 +1,7 @@ # Testing - -Testing in C verifies that code behaves correctly, an area the language itself provides minimal built-in support for beyond the simple `assert` macro. Dedicated testing frameworks like Unity, CMocka, and Check add structure for organizing test cases, running them automatically, and reporting results, similar to unit testing frameworks in other languages. Establishing a testing habit early helps catch regressions as a C codebase grows. \ No newline at end of file + +Testing in C verifies that code behaves correctly, an area the language itself provides minimal built-in support for beyond the simple `assert` macro. Dedicated testing frameworks like Unity, CMocka, and Check add structure for organizing test cases, running them automatically, and reporting results, similar to unit testing frameworks in other languages. Establishing a testing habit early helps catch regressions as a C codebase grows. + +Visit the following resources to learn more: + +- [@article@Embedded C/C++ Unit Testing Fundamentals](https://www.parasoft.com/blog/embedded-unit-testing/) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/text-processing@-2pX0L0KsAsSOBne4_lOu.md b/src/data/roadmaps/c/content/text-processing@-2pX0L0KsAsSOBne4_lOu.md index 764b49571..d64c2fd21 100644 --- a/src/data/roadmaps/c/content/text-processing@-2pX0L0KsAsSOBne4_lOu.md +++ b/src/data/roadmaps/c/content/text-processing@-2pX0L0KsAsSOBne4_lOu.md @@ -1,3 +1,9 @@ # Text Processing - -Text processing functions, mostly from `` and ``, handle operations on C strings and characters, such as measuring length (`strlen`), copying (`strcpy`), concatenating (`strcat`), comparing (`strcmp`), and classifying individual characters as alphabetic, numeric, or whitespace. Many of these functions assume null-terminated strings and do not check buffer sizes, so using safer, bounded variants where available reduces the risk of buffer overflows. They form the core toolkit for any program that manipulates text. \ No newline at end of file + +Text processing functions, mostly from `` and ``, handle operations on C strings and characters, such as measuring length (`strlen`), copying (`strcpy`), concatenating (`strcat`), comparing (`strcmp`), and classifying individual characters as alphabetic, numeric, or whitespace. Many of these functions assume null-terminated strings and do not check buffer sizes, so using safer, bounded variants where available reduces the risk of buffer overflows. They form the core toolkit for any program that manipulates text. + +Visit the following resources to learn more: + +- [@article@C string (string.h) Library](https://www.w3schools.com/c/c_ref_string.php) +- [@article@C String Functions](https://www.w3schools.com/c/c_strings_functions.php) +- [@article@C Programming Strings](https://www.programiz.com/c-programming/c-strings) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/tinycc@bULHRcaOth5MzdDmazlH4.md b/src/data/roadmaps/c/content/tinycc@bULHRcaOth5MzdDmazlH4.md index 438c6288b..ce2e66f26 100644 --- a/src/data/roadmaps/c/content/tinycc@bULHRcaOth5MzdDmazlH4.md +++ b/src/data/roadmaps/c/content/tinycc@bULHRcaOth5MzdDmazlH4.md @@ -1,3 +1,9 @@ # TinyCC - -TinyCC, also called tcc, is a small, fast C compiler that prioritizes compilation speed over generating optimized machine code. It can compile and run C code almost instantly, making it useful for scripting-like use cases or quick testing, though the resulting binaries are typically slower than those produced by GCC or Clang with optimizations enabled. Its small size also makes it practical for embedding in other tools. \ No newline at end of file + +TinyCC, also called tcc, is a small, fast C compiler that prioritizes compilation speed over generating optimized machine code. It can compile and run C code almost instantly, making it useful for scripting-like use cases or quick testing, though the resulting binaries are typically slower than those produced by GCC or Clang with optimizations enabled. Its small size also makes it practical for embedding in other tools. + +Visit the following resources to learn more: + +- [@article@TinyCC Docs](https://bellard.org/tcc/tcc-doc.html#Introduction) +- [@article@TinyCC - Wikipedia](https://en.wikipedia.org/wiki/Tiny_C_Compiler) +- [@video@Tiny C Compiler setup and usage 2022](https://www.youtube.com/watch?v=7mmp06nmO44) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/type-conversion@u6JYFgz8uba4AGDzaM9KS.md b/src/data/roadmaps/c/content/type-conversion@u6JYFgz8uba4AGDzaM9KS.md index 73a648ab8..19062bd5e 100644 --- a/src/data/roadmaps/c/content/type-conversion@u6JYFgz8uba4AGDzaM9KS.md +++ b/src/data/roadmaps/c/content/type-conversion@u6JYFgz8uba4AGDzaM9KS.md @@ -1,3 +1,9 @@ # Type Conversion - -Type conversion changes a value from one data type to another, either automatically by the compiler (implicit conversion) or explicitly by the programmer using a cast, such as `(int)3.9`. Implicit conversions follow C's promotion rules, for example converting a `char` to an `int` in arithmetic, and can sometimes cause unexpected precision loss or overflow. Explicit casts give the programmer direct control but also make it easy to silently discard data if used carelessly. \ No newline at end of file + +Type conversion changes a value from one data type to another, either automatically by the compiler (implicit conversion) or explicitly by the programmer using a cast, such as `(int)3.9`. Implicit conversions follow C's promotion rules, for example converting a `char` to an `int` in arithmetic, and can sometimes cause unexpected precision loss or overflow. Explicit casts give the programmer direct control but also make it easy to silently discard data if used carelessly. + +Visit the following resources to learn more: + +- [@article@Type Casting in C](https://www.tutorialspoint.com/cprogramming/c_type_casting.htm) +- [@article@C Type Conversion](https://www.w3schools.com/c/c_type_conversion.php) +- [@video@Type Conversion in C |](https://www.youtube.com/watch?v=xi2wf0Zy2Y4) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/type-qualifiers@5XkKGcxVTnuI09XpY7ntD.md b/src/data/roadmaps/c/content/type-qualifiers@5XkKGcxVTnuI09XpY7ntD.md index c7f4e4a5d..e2bed4579 100644 --- a/src/data/roadmaps/c/content/type-qualifiers@5XkKGcxVTnuI09XpY7ntD.md +++ b/src/data/roadmaps/c/content/type-qualifiers@5XkKGcxVTnuI09XpY7ntD.md @@ -1,3 +1,9 @@ # Type Qualifiers - -Type qualifiers add extra meaning to a variable's declaration beyond its basic type, telling the compiler how the variable can be used or how it might change. C provides four standard qualifiers: `const`, `volatile`, `restrict`, and `_Atomic`. They do not change how much memory a variable uses, but they do affect what optimizations the compiler is allowed to make and what guarantees the programmer gets. \ No newline at end of file + +Type qualifiers add extra meaning to a variable's declaration beyond its basic type, telling the compiler how the variable can be used or how it might change. C provides four standard qualifiers: `const`, `volatile`, `restrict`, and `_Atomic`. They do not change how much memory a variable uses, but they do affect what optimizations the compiler is allowed to make and what guarantees the programmer gets. + +Visit the following resources to learn more: + +- [@article@Type Qualifiers](https://learn.microsoft.com/en-us/cpp/c-language/type-qualifiers?view=msvc-170) +- [@article@Type Qualifiers in C](https://www.naukri.com/code360/library/type-qualifiers-in-c) +- [@article@_Atomic keyword in C](https://aticleworld.com/what-is-_atomic-keyword-in-c/) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/typedef@fE1c9niOycVP6mb9VlVgS.md b/src/data/roadmaps/c/content/typedef@fE1c9niOycVP6mb9VlVgS.md new file mode 100644 index 000000000..ebf442186 --- /dev/null +++ b/src/data/roadmaps/c/content/typedef@fE1c9niOycVP6mb9VlVgS.md @@ -0,0 +1,8 @@ +# Typedef + +`typedef` creates an alias for an existing type, which can shorten complex type declarations or make code more portable and readable, for example `typedef unsigned long size_t;`. It is commonly used with structs to avoid repeating the `struct` keyword every time the type is used. `typedef` does not create a new distinct type, it is purely a naming convenience for the compiler. + +Visit the following resources to learn more: + +- [@article@Typedef in C](https://www.tutorialspoint.com/cprogramming/c_typedef.htm) +- [@video@C typedef 📛](https://www.youtube.com/watch?v=CI9dRTvzgqE) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/undefined-behavior@qfLrVwFd85vUG9RMrGzrc.md b/src/data/roadmaps/c/content/undefined-behavior@qfLrVwFd85vUG9RMrGzrc.md index c93ef901e..7c4867ef3 100644 --- a/src/data/roadmaps/c/content/undefined-behavior@qfLrVwFd85vUG9RMrGzrc.md +++ b/src/data/roadmaps/c/content/undefined-behavior@qfLrVwFd85vUG9RMrGzrc.md @@ -1,3 +1,9 @@ # Undefined Behavior - -Undefined behavior refers to code whose outcome the C standard places no constraints on, meaning a compiler is free to produce any result, including seemingly correct output, a crash, or subtle corruption that only appears under certain conditions. Common causes include signed integer overflow, reading uninitialized memory, out-of-bounds array access, and dereferencing invalid pointers. Because undefined behavior can appear to work correctly during testing and then fail later or on a different compiler, it is one of the most important sources of hard-to-diagnose bugs in C. \ No newline at end of file + +Undefined behavior refers to code whose outcome the C standard places no constraints on, meaning a compiler is free to produce any result, including seemingly correct output, a crash, or subtle corruption that only appears under certain conditions. Common causes include signed integer overflow, reading uninitialized memory, out-of-bounds array access, and dereferencing invalid pointers. Because undefined behavior can appear to work correctly during testing and then fail later or on a different compiler, it is one of the most important sources of hard-to-diagnose bugs in C. + +Visit the following resources to learn more: + +- [@article@Undefined behavior](https://en.cppreference.com/c/language/behavior) +- [@article@Undefined Behavior in C and C++](https://dev.to/pauljlucas/undefined-behavior-in-c-and-c-3a20) +- [@video@Undefined behavior in C and why you should know about it](https://www.youtube.com/watch?v=va_UZwTVR5g) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/unions@KOerKv8-2VV8WBziDHzv4.md b/src/data/roadmaps/c/content/unions@KOerKv8-2VV8WBziDHzv4.md index aa44dc2aa..5c178ef84 100644 --- a/src/data/roadmaps/c/content/unions@KOerKv8-2VV8WBziDHzv4.md +++ b/src/data/roadmaps/c/content/unions@KOerKv8-2VV8WBziDHzv4.md @@ -1,3 +1,9 @@ # Unions - -A `union` allows multiple members to share the same memory location, so only one member holds a valid value at any given time, and the union's size equals that of its largest member. This is useful for saving memory when different pieces of data are never needed simultaneously, or for interpreting the same bytes in different ways. Reading a union member other than the one most recently written to is generally undefined behavior, except in specific cases the standard permits. \ No newline at end of file + +A `union` allows multiple members to share the same memory location, so only one member holds a valid value at any given time, and the union's size equals that of its largest member. This is useful for saving memory when different pieces of data are never needed simultaneously, or for interpreting the same bytes in different ways. Reading a union member other than the one most recently written to is generally undefined behavior, except in specific cases the standard permits. + +Visit the following resources to learn more: + +- [@article@Unions in C](https://www.tutorialspoint.com/cprogramming/c_unions.htm) +- [@article@Union declaration](https://en.cppreference.com/c/language/union) +- [@video@Introduction to Unions in C](https://www.youtube.com/watch?v=oySsPUDr35U) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/unity@Si0kEq0CN8hPsgIgsyO_q.md b/src/data/roadmaps/c/content/unity@Si0kEq0CN8hPsgIgsyO_q.md index 184aaf626..5fe0e9e16 100644 --- a/src/data/roadmaps/c/content/unity@Si0kEq0CN8hPsgIgsyO_q.md +++ b/src/data/roadmaps/c/content/unity@Si0kEq0CN8hPsgIgsyO_q.md @@ -1,3 +1,9 @@ # Unity - -Unity is a lightweight unit testing framework for C, designed with embedded systems in mind, requiring minimal dependencies and working even on platforms without a full standard library. It provides a set of assertion macros for checking expected values and organizing tests into runnable suites. Its small footprint makes it a common choice for testing firmware and other resource-constrained environments. \ No newline at end of file + +Unity is a lightweight unit testing framework for C, designed with embedded systems in mind, requiring minimal dependencies and working even on platforms without a full standard library. It provides a set of assertion macros for checking expected values and organizing tests into runnable suites. Its small footprint makes it a common choice for testing firmware and other resource-constrained environments. + +Visit the following resources to learn more: + +- [@official@Unity](https://www.throwtheswitch.org/unity) +- [@opensource@unity](https://github.com/throwtheswitch/unity) +- [@video@Unit Test using Unity Framework Tutorial](https://www.youtube.com/watch?v=x2zwahFZHr8) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/user-defined-types@YQxkVgaNSJ4fNCqLFy9ap.md b/src/data/roadmaps/c/content/user-defined-types@YQxkVgaNSJ4fNCqLFy9ap.md index 769b109dc..fdce82305 100644 --- a/src/data/roadmaps/c/content/user-defined-types@YQxkVgaNSJ4fNCqLFy9ap.md +++ b/src/data/roadmaps/c/content/user-defined-types@YQxkVgaNSJ4fNCqLFy9ap.md @@ -1,3 +1,8 @@ # User-Defined Types - -User-defined types let a programmer group related data or give existing types new names, going beyond the basic built-in types. C provides `struct` for grouping different types together, `union` for storing different types in the same memory, `enum` for naming a set of related integer constants, and `typedef` for creating aliases for existing types. These tools make code more organized and self-documenting when modeling real-world data. \ No newline at end of file + +User-defined types let a programmer group related data or give existing types new names, going beyond the basic built-in types. C provides `struct` for grouping different types together, `union` for storing different types in the same memory, `enum` for naming a set of related integer constants, and `typedef` for creating aliases for existing types. These tools make code more organized and self-documenting when modeling real-world data. + +Visit the following resources to learn more: + +- [@article@A Beginner’s Guide to Data Types in C Programming](https://medium.com/@c2w.extras/a-beginners-guide-to-data-types-in-c-programming-mastering-memory-and-variables-f2602a4a3464) +- [@video@User Defined Datatypes in C Language | C Tutorial for Beginners](https://www.youtube.com/watch?v=DIbmZn6ZgKU) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/valgrind@nFhLGsMaqv2fE2WadHwGK.md b/src/data/roadmaps/c/content/valgrind@nFhLGsMaqv2fE2WadHwGK.md index a7381bc28..2154f9249 100644 --- a/src/data/roadmaps/c/content/valgrind@nFhLGsMaqv2fE2WadHwGK.md +++ b/src/data/roadmaps/c/content/valgrind@nFhLGsMaqv2fE2WadHwGK.md @@ -1,3 +1,8 @@ # Valgrind - -Valgrind is a dynamic analysis tool that runs a compiled program inside a virtual environment to detect memory errors, such as reading uninitialized memory, using memory after it has been freed, and memory leaks, at runtime. Its most commonly used tool, Memcheck, reports the exact line where a memory error occurred, including the point where the involved memory was originally allocated. Running a program under Valgrind significantly slows its execution, which makes it more suitable for testing than production use. \ No newline at end of file + +Valgrind is a dynamic analysis tool that runs a compiled program inside a virtual environment to detect memory errors, such as reading uninitialized memory, using memory after it has been freed, and memory leaks, at runtime. Its most commonly used tool, Memcheck, reports the exact line where a memory error occurred, including the point where the involved memory was originally allocated. Running a program under Valgrind significantly slows its execution, which makes it more suitable for testing than production use. + +Visit the following resources to learn more: + +- [@article@Guide to valgrind](https://web.stanford.edu/class/archive/cs/cs107/cs107.1174/guide_valgrind.html) +- [@video@C Dynamic Memory Debugging with Valgrind](https://www.youtube.com/watch?v=bb1bTJtgXrI) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/variable-scopes@-Ea7jUSf6nHieVssBefno.md b/src/data/roadmaps/c/content/variable-scopes@-Ea7jUSf6nHieVssBefno.md index fbda1a69a..54b828a4d 100644 --- a/src/data/roadmaps/c/content/variable-scopes@-Ea7jUSf6nHieVssBefno.md +++ b/src/data/roadmaps/c/content/variable-scopes@-Ea7jUSf6nHieVssBefno.md @@ -1,3 +1,8 @@ # Variable Scopes - -Variable scope determines where in a program a variable can be accessed. Variables declared inside a function or block are local and only visible within that block, while variables declared outside any function are global and visible throughout the file, or across files if declared `extern`. Local variables generally exist only for the duration of the block they are declared in, and using a name from an outer scope inside a nested block temporarily hides the outer variable. \ No newline at end of file + +Variable scope determines where in a program a variable can be accessed. Variables declared inside a function or block are local and only visible within that block, while variables declared outside any function are global and visible throughout the file, or across files if declared `extern`. Local variables generally exist only for the duration of the block they are declared in, and using a name from an outer scope inside a nested block temporarily hides the outer variable. + +Visit the following resources to learn more: + +- [@article@C Scope Rules](https://www.tutorialspoint.com/cprogramming/c_scope_rules.htm) +- [@video@Scope of Variables - Local vs Global](https://www.youtube.com/watch?v=elMQ5YtZPxA&t=19s) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/variables@0pJTCnKRsjgkgrGkBR_m-.md b/src/data/roadmaps/c/content/variables@0pJTCnKRsjgkgrGkBR_m-.md index a7175d2d5..17bebd0fd 100644 --- a/src/data/roadmaps/c/content/variables@0pJTCnKRsjgkgrGkBR_m-.md +++ b/src/data/roadmaps/c/content/variables@0pJTCnKRsjgkgrGkBR_m-.md @@ -1,3 +1,9 @@ # Variables - -A variable in C is a named piece of memory that holds a value of a specific type, such as an integer or a character. Every variable must be declared with a type before use, since C is statically typed and does not infer types automatically. Variables can be reassigned during a program's execution, unlike constants, and their scope determines where in the code they can be accessed. \ No newline at end of file + +A variable in C is a named piece of memory that holds a value of a specific type, such as an integer or a character. Every variable must be declared with a type before use, since C is statically typed and does not infer types automatically. Variables can be reassigned during a program's execution, unlike constants, and their scope determines where in the code they can be accessed. + +Visit the following resources to learn more: + +- [@article@C Variables](https://www.w3schools.com/c/c_variables.php) +- [@article@C - Variables](https://www.tutorialspoint.com/cprogramming/c_variables.htm) +- [@video@C variables 💰](https://www.youtube.com/watch?v=aIQk1O08zpg) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/variadic-functions@e20yctd9zyACyfHgM5vQy.md b/src/data/roadmaps/c/content/variadic-functions@e20yctd9zyACyfHgM5vQy.md index 4da09ce57..a5502faa9 100644 --- a/src/data/roadmaps/c/content/variadic-functions@e20yctd9zyACyfHgM5vQy.md +++ b/src/data/roadmaps/c/content/variadic-functions@e20yctd9zyACyfHgM5vQy.md @@ -1,3 +1,8 @@ # Variadic Functions - -Variadic functions accept a variable number of arguments, like `printf`, which can take any number of values depending on its format string. They are declared using an ellipsis (`...`) as the last parameter and accessed inside the function using macros from ``, such as `va_start`, `va_arg`, and `va_end`. Because the compiler cannot type-check variadic arguments the way it does regular parameters, mismatches between expected and actual argument types are a common source of bugs. \ No newline at end of file + +Variadic functions accept a variable number of arguments, like `printf`, which can take any number of values depending on its format string. They are declared using an ellipsis (`...`) as the last parameter and accessed inside the function using macros from ``, such as `va_start`, `va_arg`, and `va_end`. Because the compiler cannot type-check variadic arguments the way it does regular parameters, mismatches between expected and actual argument types are a common source of bugs. + +Visit the following resources to learn more: + +- [@article@Variadic Functions in C](https://www.tutorialspoint.com/cprogramming/c_variadic_functions.htm) +- [@video@How to create functions with a variable number of arguments](https://www.youtube.com/watch?v=3iX9a_l9W9Y) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/vcpkg@0uvuBpUaQjDvA5eTWRzHn.md b/src/data/roadmaps/c/content/vcpkg@0uvuBpUaQjDvA5eTWRzHn.md index 2a9515d7f..02449885f 100644 --- a/src/data/roadmaps/c/content/vcpkg@0uvuBpUaQjDvA5eTWRzHn.md +++ b/src/data/roadmaps/c/content/vcpkg@0uvuBpUaQjDvA5eTWRzHn.md @@ -1,3 +1,8 @@ # vcpkg - -vcpkg is an open-source package manager from Microsoft for C and C++ libraries, supporting Windows, Linux, and macOS. It builds libraries from source for the target platform and compiler, then integrates them with build systems like CMake or Visual Studio. Its cross-platform support has made it a common choice for projects that need to build consistently across different operating systems. \ No newline at end of file + +vcpkg is an open-source package manager from Microsoft for C and C++ libraries, supporting Windows, Linux, and macOS. It builds libraries from source for the target platform and compiler, then integrates them with build systems like CMake or Visual Studio. Its cross-platform support has made it a common choice for projects that need to build consistently across different operating systems. + +Visit the following resources to learn more: + +- [@official@vcpkg overview](https://learn.microsoft.com/en-gb/vcpkg/get_started/overview) +- [@video@vcpkg Crash Course](https://www.youtube.com/watch?v=0h1lC3QHLHU&t=80s) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/vim--nvim@BJ0X8EEdTxh2POVpIOJQV.md b/src/data/roadmaps/c/content/vim--nvim@BJ0X8EEdTxh2POVpIOJQV.md index ba32dbf54..a039ff966 100644 --- a/src/data/roadmaps/c/content/vim--nvim@BJ0X8EEdTxh2POVpIOJQV.md +++ b/src/data/roadmaps/c/content/vim--nvim@BJ0X8EEdTxh2POVpIOJQV.md @@ -1,3 +1,10 @@ # vim / nvim - -vim and its modern fork neovim are terminal-based text editors known for keyboard-driven, modal editing rather than a traditional mouse-and-menu interface. They are lightweight and run over SSH, which makes them popular for editing C code on remote servers or embedded systems. Configuring one for C development, such as adding syntax highlighting or a language server, takes some initial setup but rewards frequent use with speed. \ No newline at end of file + +vim and its modern fork neovim are terminal-based text editors known for keyboard-driven, modal editing rather than a traditional mouse-and-menu interface. They are lightweight and run over SSH, which makes them popular for editing C code on remote servers or embedded systems. Configuring one for C development, such as adding syntax highlighting or a language server, takes some initial setup but rewards frequent use with speed. + +Visit the following resources to learn more: + +- [@official@Downloading Vim](https://www.vim.org/download.php) +- [@official@Installing Neovim](https://neovim.io/doc/install/) +- [@article@Getting Started Vim for C/C++](https://www.reddit.com/r/neovim/comments/vxyeti/getting_started_vim_for_cc/) +- [@article@Make Vim as your C/C++ IDE](https://blog.devgenius.io/make-vim-as-your-c-c-ide-2be2de70819e) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/void-pointers@LWsaf-bUIAilXbobQCHv9.md b/src/data/roadmaps/c/content/void-pointers@LWsaf-bUIAilXbobQCHv9.md index d96961652..296cb0152 100644 --- a/src/data/roadmaps/c/content/void-pointers@LWsaf-bUIAilXbobQCHv9.md +++ b/src/data/roadmaps/c/content/void-pointers@LWsaf-bUIAilXbobQCHv9.md @@ -1,3 +1,8 @@ # void Pointers - -A `void` pointer, declared as `void *`, can point to any data type but cannot be dereferenced directly, since the compiler has no type information about what it points to. It is typically cast to a specific pointer type before use, and appears often in generic functions like `malloc`, which returns `void *` because it has no knowledge of what type of data will be stored there. This flexibility comes at the cost of losing type safety until the cast happens. \ No newline at end of file + +A `void` pointer, declared as `void *`, can point to any data type but cannot be dereferenced directly, since the compiler has no type information about what it points to. It is typically cast to a specific pointer type before use, and appears often in generic functions like `malloc`, which returns `void *` because it has no knowledge of what type of data will be stored there. This flexibility comes at the cost of losing type safety until the cast happens. + +Visit the following resources to learn more: + +- [@article@void pointer in C](https://www.tutorialspoint.com/cprogramming/c_void_pointer.htm) +- [@video@Understanding the Void Pointers](https://www.youtube.com/watch?v=ij2jrsUmwCI) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/volatile@_KdE4w3OfOMt5EYWkCCVQ.md b/src/data/roadmaps/c/content/volatile@_KdE4w3OfOMt5EYWkCCVQ.md index 7ce366dd7..ebd58d2d7 100644 --- a/src/data/roadmaps/c/content/volatile@_KdE4w3OfOMt5EYWkCCVQ.md +++ b/src/data/roadmaps/c/content/volatile@_KdE4w3OfOMt5EYWkCCVQ.md @@ -1,3 +1,8 @@ # volatile - -The `volatile` qualifier tells the compiler that a variable's value can change unexpectedly, outside the normal flow of the program, such as through hardware registers or signal handlers. This prevents the compiler from applying optimizations that assume the variable's value stays the same between reads. It is common in embedded programming and low-level code that interacts directly with hardware. \ No newline at end of file + +The `volatile` qualifier tells the compiler that a variable's value can change unexpectedly, outside the normal flow of the program, such as through hardware registers or signal handlers. This prevents the compiler from applying optimizations that assume the variable's value stays the same between reads. It is common in embedded programming and low-level code that interacts directly with hardware. + +Visit the following resources to learn more: + +- [@article@“What volatile Really Does — and Doesn’t Do” — in C](https://medium.com/@wongjushao/what-volatile-really-does-and-doesnt-do-in-c-7a98e9e135c3) +- [@video@How to use the volatile keyword in C?](https://www.youtube.com/watch?v=6tIWFEzzx9I) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/vscode@g4Jne3Ok5KqLdRKcv000s.md b/src/data/roadmaps/c/content/vscode@g4Jne3Ok5KqLdRKcv000s.md index 4f29bd280..22c765b11 100644 --- a/src/data/roadmaps/c/content/vscode@g4Jne3Ok5KqLdRKcv000s.md +++ b/src/data/roadmaps/c/content/vscode@g4Jne3Ok5KqLdRKcv000s.md @@ -1,3 +1,9 @@ # VSCode - -Visual Studio Code is a free, extensible code editor from Microsoft that supports C through extensions like the C/C++ extension pack. It offers syntax highlighting, IntelliSense autocomplete, integrated debugging, and build task configuration through simple JSON files. Its balance of features and ease of setup makes it a common choice for C beginners on any operating system. \ No newline at end of file + +Visual Studio Code is a free, extensible code editor from Microsoft that supports C through extensions like the C/C++ extension pack. It offers syntax highlighting, IntelliSense autocomplete, integrated debugging, and build task configuration through simple JSON files. Its balance of features and ease of setup makes it a common choice for C beginners on any operating system. + +Visit the following resources to learn more: + +- [@official@C/C++ for Visual Studio Code](https://code.visualstudio.com/docs/languages/cpp) +- [@video@ES Skip navigation vscode for c Create Avatar image How to Set up Visual Studio Code for C and C++ Programming](https://www.youtube.com/watch?v=1PBD5qFWdq8) +- [@video@Start C programming in 15 minutes! ⚙️](https://www.youtube.com/watch?v=2ciUcosJFBc) \ No newline at end of file diff --git a/src/data/roadmaps/c/content/windbg@w1AYTM94VDO2YMQoKkXFq.md b/src/data/roadmaps/c/content/windbg@w1AYTM94VDO2YMQoKkXFq.md index eb5b9144b..36479f6bc 100644 --- a/src/data/roadmaps/c/content/windbg@w1AYTM94VDO2YMQoKkXFq.md +++ b/src/data/roadmaps/c/content/windbg@w1AYTM94VDO2YMQoKkXFq.md @@ -1,3 +1,8 @@ # WinDbg - -WinDbg is a debugger from Microsoft for Windows programs, capable of both live debugging and analyzing crash dump files after a program has already terminated. It is commonly used for debugging Windows-specific issues, including kernel-level and driver debugging, that other cross-platform debuggers do not handle. Its interface and command set differ significantly from GDB or LLDB, reflecting its Windows-specific origins. \ No newline at end of file + +WinDbg is a debugger from Microsoft for Windows programs, capable of both live debugging and analyzing crash dump files after a program has already terminated. It is commonly used for debugging Windows-specific issues, including kernel-level and driver debugging, that other cross-platform debuggers do not handle. Its interface and command set differ significantly from GDB or LLDB, reflecting its Windows-specific origins. + +Visit the following resources to learn more: + +- [@official@install WinDbg](https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/) +- [@video@Debugging C/C++ Programs from Scratch with WinDbg: A Beginner's Guide](https://www.youtube.com/watch?v=AgtgZDsADUI) \ No newline at end of file