We can create multiple threads in our C program to execute multiple tasks in parallel. It helps to utilize the CPU resources efficiently. Even though core C programming does not support multithreading, at least until C11 standard, it has a lot of library support for that purpose. POSIX thread or pthread is one of the … Continue reading “Multithreading in C”
Tag: C Programming
Backpointer – Concept and Application
We often work with data structures with connected nodes – like trees and graphs. In a tree, the parent nodes generally hold the pointers of their child nodes. But the child nodes can also hold the pointer back to their parent. Developers often refer this type of pointers as backpointers. In this diagram, the black … Continue reading “Backpointer – Concept and Application”
Bit Fields in C
The variable size of a standard type is always in bytes – not in fraction of bytes. For example, the size of a char type variable is 1, short type variable is 1, in type variable is 4 and so on. We can not have a variable of size half byte (4 bits) or 1 … Continue reading “Bit Fields in C”
Networking Programming – Introduction to socket
Computer networking programming, often referred as socket programming, is about writing programs to exchange information between processes running on connected hosts – computers, mobiles etc. Hosts are generally interconnected over a private network (LAN) or internet. In fact, the processes can run on a single host or computer also. Most applications today, desktop or mobile, … Continue reading “Networking Programming – Introduction to socket”
C Program to Append to a File
Appending to a means adding the new content at the end of the file retaining the old content intact. If the file is opened in normal write mode, the new content will replace the old content. Here we’ll see how to open a file in append mode Logic to Append to a File Declare a … Continue reading “C Program to Append to a File”