Topics

C

About this topic: Articles tagged __TAG__

Showing 160 articles

Topics

Articles

Showing 160 articles

How-tos How to Get Length of Char Array in C This article demonstrates how to get the length of a char array in C. How-tos How to Initialize Array of Structs in C Initialize an array of structs in C with a brace list, runtime allocation, or a function and loop, with guidance on memory cleanup and safe string copying. How-tos How to Use the execlp Function in C This article introduces how to use the execlp function in C How-tos How to Compare Bits in C This article demonstrates how to compare bits in C. How-tos Try Catch in C This article demonstrates an example of implementing try-catch behavior in C, which by default, does not support try-catch/exception handling mechanisms. How-tos How to Convert a C Program to Assembly This compact guide to convert a C program to Assembly equivalent. How-tos How to Convert Integer to Char in C Learn when to add '0', assign an integer value to char, or format a character as a string in C. How-tos How to Use the strdup Function in C Learn how strdup duplicates a string in C, how to check and free its allocated copy, and when to use strndup or GNU strdupa. How-tos Arithmetic Right Shift in C Learn how C's single >> operator shifts unsigned values and why right-shifting a negative signed integer is not portable. How-tos The register Keyword in C Learn how the register storage-class specifier works in C, including declarations, address restrictions, pointers, and scope. How-tos How to Print a Hexadecimal Value in C This article demonstrates how to print a hexadecimal value in C Programming Language. How-tos How to Initialize an Array to 0 in C Learn how to initialize a C array to zero with {0}, a loop, or memset, and when C zero-initializes an array automatically. How-tos How to Check if String Contains Substring in C Check whether a C string contains an exact substring with the standard strstr function, a manual loop, or the GNU strcasestr extension for case-insensitive matching. How-tos How to Align Columns in printf Function in C Learn how to align C output with printf field widths, dynamic widths, and zero-padded integers. How-tos MIN and MAX Function in C One can use macros or loops to implement the MIN and MAX function in C. How-tos How to Read File Line by Line Using fscanf in C Learn how fscanf reads bounded line content and whitespace-delimited tokens in C, and when fgets is the better choice for reliable line input. How-tos i++ vs ++i in C This article explores the differences between the prefix increment operator (++i) and the postfix increment operator (i++) in C programming. Learn how to use these operators … How-tos How to Use typedef enum in C This article introduces how to use typedef enum in C, explaining its benefits and providing clear examples. Learn how to enhance code readability and maintainability with typedef … How-tos How to Read a File in C This article introduces how to read a file in C, covering methods like reading character by character, line by line, and storing data in an array. Learn essential techniques and … How-tos How to Print Formatted Text in C This article demonstrates how to print formatted text in C using the printf function. Learn about format specifiers, controlling output width, and special characters to enhance … How-tos How to Fix Free Invalid Pointer Error in C This article introduces how to fix free invalid pointer errors in C programming. Learn effective methods to troubleshoot and resolve memory management issues, including using … How-tos How to Compare Strings in C This article introduces how to compare strings in C, covering essential methods like `strcmp`, `strncmp`, and manual comparison. Learn the nuances of string representation and gain … How-tos The Modulo Operator in C This article introduces the modulo operator in C, explaining its usage and applications. Learn how to check even and odd numbers, use it in loops, and see clear examples to enhance … How-tos How to wait Function in C This article introduces how to use the wait function in C, providing insights into process management. Learn about its syntax, see practical code examples, and understand error …

← All topics