Practical solutions

C Howtos How-To Guides

Solve the problem. Keep building. Collection of C how-to articles

Find the answer you need

Browse practical solutions, grouped by the task you're working on.

__COUNT__ entries on this page

How to Print to Stderr in CThis article introduces how to print to stderr in C. How to Get Size of a Pointer in CLearn how sizeof measures a pointer object in C and how that differs from the pointed-to object and an allocation. How to Use the Feof() Function in CThis article demonstrates how to use the feof function in C. How to Find System Hostname in CRetrieve the current system hostname in C with POSIX gethostname(), or read its node name with uname(). Learn how to check errors and choose a suitable buffer. How to Use Atomic Types in CThis article introduces how to use atomic types in C How to Convert a String to Integer in CThis article introduces different methods in C to convert a string into an integer How to Sort Function in CThis article demonstrates how to use standard library sort function in C How to Create a New Directory in CLearn to create directories in C with mkdir, choose effective permission bits, handle existing paths and other errors, and use mkdirat for directory-relative creation. The Forward Declaration and Difference Between Struct and Typedef Struct in CThis short article discusses the difference between struct and the typedef struct. It further elaborates the concept of forward declaration in C. How to Use the mmap Function to Write to the Memory in CLearn how mmap() maps memory in C, how to choose its arguments, and how to write to anonymous memory. How to Use the sched_setaffinity Function in CThis article demonstrates how to use sched_setaffinity function in C How to Clear Char Array in CThis article demonstrates how to clear char array in C. Regular Expressions in CIn this article, we'll talk about regular expressions in C. Difference Between Unsigned Int and Signed Int in CThe following article will explore the distinctions between signed and unsigned int in the C programming language. Exponents in CThis article introduces how to use exponentiation functions in C, focusing on the `pow()` function and custom implementations. Learn to calculate positive and negative exponents effectively with clear examples and explanations. Whether you're a beginner or looking to enhance your programming skills, discover the best practices for handling exponentiation in C. The dup2 Function in CLearn how dup2 duplicates file descriptors in C, redirects standard input and output, differs from dup, and how to handle errors and descriptor lifetimes. How to Use the waitpid Function in CThis article introduces how to use waitpid function in C How to Use the gettimeofday Function in CLearn how to measure elapsed and CPU time in C with gettimeofday, clock_gettime, and clock. How to Use File Redirection in CLearn how to use the shell operators <, >, and >> to redirect a C program's standard input and output. See how shell redirection differs from C stream operations such as fopen and freopen, with examples and error-handling guidance. How to Implement Dictionary in CThis article introduces how to implement dictionary in C How to Print Numbers in Scientific Notation in CThis article introduces how to print numbers in scientific notation in C. For Each Loop in CExplore the capabilities of the C programming language regarding the foreach loop. This article discusses C's lack of a built-in foreach loop and presents alternative methods for iterating over collections, including for loops, while loops, and custom functions. Gain insights into effective looping techniques that can enhance your C programming skills. File Descriptor in CThis article explains about the file descriptor in C Programming Language. How to Get the Size of Array in CThis tutorial introduces methods in C to determine the size of an array. Learn how to effectively use the sizeof() operator and explore alternative methods like macros and functions. Mastering these techniques is essential for efficient memory management and array handling in C programming.