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

%G Format Specifier in CThis article explains the %g format specifier in C programming, detailing its function, usage, and differences from other specifiers. Discover how to format floating-point numbers effectively with examples and tips for precision control. Perfect for beginners and experienced programmers alike, this guide will enhance your coding skills and improve the readability of your numerical outputs. Logical XOR Operator in CThis article explains the logical XOR operator in C programming, detailing its syntax, applications, and implementation. Learn how to use XOR for toggling states, error detection, and cryptography with clear examples and code snippets. Whether you're a beginner or an experienced programmer, this guide will enhance your understanding of logical operations in C. Null Terminated Strings in CExplore the intricacies of null-terminated strings in C with this comprehensive tutorial. Learn how to create, manipulate, and avoid common pitfalls associated with these strings. Perfect for beginners and experienced programmers alike, this guide will enhance your understanding of string handling in C programming. How to Get Substring in CThis article introduces how to get a substring in C, covering various methods like custom functions, `strncpy`, and pointer arithmetic. Learn to manipulate strings efficiently and enhance your coding skills with clear examples and explanations. Discover the power of substrings in C programming today! Static Variable in CThis article introduces static variables in C, explaining their usage, benefits, and limitations. Learn how to efficiently retain variable values between function calls and optimize your code with practical examples. Perfect for programmers looking to enhance their understanding of C programming concepts. How to Write to File in CThis article introduces how to write to file in C, covering essential techniques like creating, appending, and managing file operations. Learn practical examples and error handling to enhance your C programming skills effectively. Whether you're a beginner or an experienced coder, mastering file writing in C is crucial for data management. How to Create a Table in CLearn how to create tables in C using arrays with this comprehensive guide. Discover one-dimensional and two-dimensional arrays, and explore functions to handle tables effectively. Perfect for beginners and seasoned programmers alike, this article provides clear examples and explanations to help you master data structures in C. How to Compile a C File on MacThis tutorial demonstrates how to compile a .c file on a Mac operating system. Learn the essential commands to compile C files using the terminal, how to utilize Makefiles for larger projects, and troubleshoot common compilation errors. Whether you are a beginner or an experienced programmer, this guide provides the knowledge you need to compile your C programs efficiently. How to Convert Char* to Int in CThis article demonstrates how to convert char pointer to int in C. How to Get Length of Char Array in CThis article demonstrates how to get the length of a char array in C. How to Print to Stderr in CThis article introduces how to print to stderr in C. How to Print to Stderr in CThis article introduces how to print to stderr in C. Types of Shift Operators in CThis article introduces how to use the right shift arithmetic operator in C. Right shifting to one position moves each bit to the right by one. The >> operator is a logical shift when shifting an unsigned value. The >> operator is an arithmetic shift when shifting is a signed value. How to Convert a Binary to Decimal in CThis article comprehensively discusses multiple C implementations to convert binary numbers into decimal equivalents. How to Get File Size in CThis article demonstrates various approaches to get file size in C, ranging from standard C library functions to platform-specific APIs. How to Convert an Integer to a String in CThis tutorial introduces different methods in C to convert an integer into a string. It describes the use of the sprintf(), snprintf(), and itoa() functions in C. How to Create Array of Structs in CThis tutorial introduces the different methods to create an array of structs in C. How to Allocate Struct Memory With malloc in CThis article demonstrates how to allocate struct memory with malloc in C. How to Use the gettimeofday Function in CThis article demonstrates how to calculate elapse time in a code block in C. How to Concatenate String and Int in CThis article introduces how to concatenate string and int in C How to Print Numbers in Scientific Notation in CThis article introduces how to print numbers in scientific notation in C. How to Get Extended Attributes of File in CThis article demonstrates how to get extended attributes of a file in C using getxattr. The %p Format Specifier in CIn this article, we will delve into the intricacies of the %p format specifier in C, exploring its functionality, use cases, and the nuances of working with pointers. Sign Extend a 9-Bit Integer in CWe are going to learn how to sign extend a nine-bit integer in C in this tutorial.