Check if a File Exists in C

If we want to see whether certain file exists or not before doing some operation like read/write … Read more

C program to get current username of Linux application

cuserid() returns a pointer to a string containing a username associated with the effective user ID of … Read more

C program to Identify size of a file using Linux stat system call

This program uses “stat” system call to read the file size. In this post, we demonstrate with … Read more

Debugging using C macros __FILE__ and __func__ and __LINE__

Following program shows a sample example of how we can use C macros __FILE__ , __func__ and … Read more

C program to read the contents of a file into character buffer

Lets say we want to read the contents of some file and want to operate on these … Read more

How to compile C program for X86 Desktop and Embedded Hardware ?

If we consider that we are working on two platforms,1. x86 – 32 or 64 bit i.e. … Read more

Difference between native compilation and cross compilation ?

If we consider that we are working on two platforms,1. x86 – 32 or 64 bit i.e. … Read more

How to resolve: error: initializer element is not constant

Sometimes during complex programing, there are chances we make some mistakes during hurry to write and complete … Read more

Error Handling in C programs using errno, perror and strerror

The perror() function produces a message on standard error describing the last error encountered during a call … Read more

Understanding ARP (Address Resolution Protocol) basics

The MAC address is how machines on a subnet communicate. When machine A sends packets to another … Read more