≡ Menu

C Programming

There are times when it is required to mix the C and C++ code together. For example, while using a legacy C code or while using a specific C library the provides your C++ code with some specific functionality. So, some special steps are to be taken care of when using C code in C++ [...]

{ 8 comments }

Loops are very basic and very useful programming facility that facilitates programmer to execute any block of code lines repeatedly and can be controlled as per conditions added by programmer. It saves writing code several times for same task. There are three types of loops in C. For loop Do while loop While loop 1. [...]

{ 15 comments }

15 Most Frequently Used GCC Compiler Command Line Options

GCC Compiler is a very powerful and popular C compiler for various Linux distributions. This article explains some of the popular GCC compiler options. An Example C Code The following basic C code (main.c) will used in this article : #include<stdio.h> int main(void) { printf("\n The Geek Stuff\n"); return 0; } GCC Compiler Options 1. [...]

{ 18 comments }

Network tools like wireshark, tcpdump, etc, are fairly popular for packet sniffing. This article provides a basic overview of the libpcap library which forms the base of packet sniffing for many network monitoring tools including wireshark, tcpdump, snort, etc. What is Packet Sniffing and How it Works? Packet sniffing is a technique through which the [...]

{ 16 comments }

C Bitwise Operators Examples – OR, AND, XOR, NOT, Left/Right Shift

Bitwise operators are used to manipulate one or more bits from integral operands like char, int, short, long. In this article, we will see the basics of bitwise operators, and some useful tips for manipulating the bits to achieve a task. This article assumes that you know the basics of Truth Table for various operators. [...]

{ 23 comments }

Linux Objdump Command Examples (Disassemble a Binary File)

Objdump command in Linux is used to provide thorough information on object files. This command is mainly used by the programmers who work on compilers, but still its a very handy tool for normal programmers also when it comes to debugging. In this article, we will understand how to use objdump command through some examples. [...]

{ 4 comments }

Linked list is one of the fundamental data structures in C. Knowledge of linked lists is must for C programmers. This article explains the fundamentals of C linked list with an example C program. Linked list is a dynamic data structure whose length can be increased or decreased at run time. How Linked lists are [...]

{ 69 comments }

12 Interesting C Interview Questions and Answers

In this article, we will discuss some interesting problems on C language that can help students to brush up their C programming skills and help them prepare their C fundamentals for interviews. 1. gets() function Question: There is a hidden problem with the following code. Can you detect it? #include<stdio.h> int main(void) { char buff[10]; [...]

{ 24 comments }