Creating a simple thread in Linux using pthread library api’s

In this post, we create a simple thread using pthread library API “pthread_create” and wait for this … Read more

feof() end-of-file indicator function in C – Example

The function feof() tests the end-of-file indicator for the stream pointed to by stream, returning nonzero if … Read more

C program to read file contents and count bytes using feof API

The function feof() tests the end-of-file indicator for the stream pointed to by stream, returning nonzero if … Read more

C code for safe read and write from a file

Below functions make sure we are safely and completely reading and writing from a file pointer fd, … Read more

C program in Linux to find the current working directory (PWD)

getcwd, getwd, get_current_dir_name functions return a null-terminated string containing an absolute pathname that is the current working … Read more

C program to convert integer number to string

Following program converts integer number 42 to string “42” using sprintf. sprintf() writes to the character string. … Read more

How to write Comments in C Program ?

In C program, comments doesn’t have any use other than for better understanding of the developers of … Read more

Sending ARP request and receiving ARP Reply using C code

This post is in continuation of our previous post “Understanding ARP (Address Resolution Protocol) basics“ To visualise … Read more