C Tutorial – Error Handling (Exception Handling)

In this C language tutorial we are going to look at error handling. Although C programming does not provide direct support for error handling (also called exception handling), there are ways to do error handling.

Of course the programmer needs to prevent errors during coding and should always test the return values of functions called by the program. A lot of C function calls return a -1 or NULL in case of an error, so quick test on these return values are easily done with for instance an ‘if statement’. More »


Posted in C Tutorials | 2 Comments


C Tutorial – Splitting a Text File into Multiple Files

A new year (have a good new year by the way) a new C language tutorial. We start the year with a C language tutorial where we will look at how to split a text file into multiple files. In previous tutorials we already looked at reading and writing text files in C examples and searching in text files, so in this tutorial we will build on these tutorials. More »


Posted in C Tutorials | 4 Comments


C Tutorial – Deleting a Record from a Binary File

In this C language tutorial we will build upon a previous C tutorial (Binary File I/O) where we took a quick look add binary file IO. In this tutorial we will take a look at how to delete a certain record (found by name) from a binary file and how to read/write a record(s) from or to a binary file. So let’s start! More »


Posted in C Tutorials | 1 Comment


C Tutorial – Call by Value or Call by Reference

In this C language tutorial we will take a look at call by value and call by reference (also known as pass-by-value and pass-by-reference). These methods are different ways of passing (or calling) data to functions. More »


Posted in C Tutorials | 101 Comments


Checking for Palindrome Strings or Numbers in C Language

In this programming algorithm tutorial we will look at how to find out if a string or number is a palindrome or not. A palindrome is a word, phrase, number or other sequence of units that has the property of reading the same in either direction. A few examples of palindrome strings are: “madam”, “dad” and “radar”. More »


Posted in Programming Algorithms | 5 Comments


How to Print Floyds Triangle in C

In this tutorial we will take a quick look at the Floyd’s triangle using the C language. The Floyd’s triangle (named after Robert Floyd) algorithm is a right-angled triangular array of natural numbers. It is defined by filling the rows of the triangle with consecutive numbers, starting with the number one in the top left corner. More »


Posted in Programming Algorithms | 10 Comments


Printing a Diamond Pattern in C

In this tutorial we are looking at how to print a diamond pattern using the C language. The diamond pattern algorithm question is often used in C courses, so it make sense that we also take a look at it. More »


Posted in Programming Algorithms | 9 Comments


C Tutorial – A Star pyramid and String triangle using for loops

In this C language tutorial we will look at a much-requested subject, printing a star pyramid and a string triangle using for loops.

We know that this question is often asked as part of homework (lab) assignments, but we got so much requests that we couldn’t ignore it. BUT we are urging you to at least try to make the homework questions yourself! At the end of this tutorial we will give two alternative questions, so you can try to fix those yourself. More »


Posted in C Tutorials | 30 Comments


C Tutorial – Number of Seconds in Decade and Visa-Versa

In a previous C language tutorial post the user “nikko manlangit” asked the following question: “How to convert seconds to decade or vice-versa?”. This C tutorial make use of time.h functions to answer his question. More »


Posted in C Tutorials | Comments Off on C Tutorial – Number of Seconds in Decade and Visa-Versa


Unary and Binary Operator Table

Below you’ll find all the unary and binary operators in one easy table: More »


Posted in C Language Reference | 8 Comments