How to Access MySQL Database from C Program?

MySQL is an open sourcce database management system (DBMS). It is very popular among the web developers as it is part of LAMP (Linux, Apache, MySQL, PHP/Perl/Python) stack. Many popular large scale websites like WikiPedia, Facebook, Youtube use this database. Many times we need to use access MySQL database from C program. Here we’ll see … Continue reading “How to Access MySQL Database from C Program?”

How to Implement Periodic and Single Shot Timers in Linux?

In our program, we often need to do some tasks repeatedly with some time interval. We can think of a simple solution of having a loop with the actual task and a sleep()..  The sleep() function can wait for some time and then we can call a function to do the task. Problem here is … Continue reading “How to Implement Periodic and Single Shot Timers in Linux?”

Detect and Remove Loop in Linked List in C

What is Loop in Linked List? In a standard singly linked list, the last node always points to NULL. If you traverse such a linked list, the traversal will end at the last node. That means you can not go anywhere from the last node. Here is an example of a standard linked list. Loop … Continue reading “Detect and Remove Loop in Linked List in C”

C Program to Sort Linked List without Allocating Extra Memory

We’ll first create a linked list which is not sorted, then we’ll re-arrange the list such that the list becomes sorted. Logic is simple, we’ll iterate the list for all nodes, in every iteration we’ll take the first node out of the original list and insert that node into a new list. At any point … Continue reading “C Program to Sort Linked List without Allocating Extra Memory”

C Program to Convert Binary Number to Decimal

Binary number system is 2-based which means at most two symbols, 0 (zero) and 1 (one), can be used to represent a binary number. Example of binary number is 110110011, sometimes binary numbers are written as 1101100112, where 2 is represented as base of the number system. Binary number system is the basis of all computer and digital systems. … Continue reading “C Program to Convert Binary Number to Decimal”

0
0
0
0
0
1