Some new lines


C Shell - Simple History command with Files

The in-memory history command implementation talked about maintaining command history in a simple shell environment. But, the issue with the design is that once user exits the shell (or the program precisely) the contents in the memory is lost and so do the session history. To take it one step further, before exiting the shell the contents of the circular buffer in which the commands are stored can be flushed to a known location (typically the user's home directory) and read back when the program is launched again.

Find Palindrome Strings in C

Like numbers, there are palindrome strings as well. These strings remain the same, even when they are written in the reverse order. When strings are large, a program can be efficient in finding palindromic strings than being checked manually. This post discusses two ways of reversing a string, and a way of finding a palindrome without actually reversing the string.

Find Palindrome numbers in C

Palindrome number is a number whose value will remain the same, even after the number is written in reverse. There are lot of such numbers exist and there are scenarios where one has to check whether a given number is palindrome or not.

Star Patterns in C - Part 2

A detailed discussion about the different patterns that can be created is given in the previous post. This post will serve the purpose of combining two patterns from the ones discussed. Four more patterns are explained here.

Star Patterns in C - Part 1

From simple to more complex, there are lot of patterns which can be created using stars ('*') in C language. Six such chosen patterns are presented along with the full implementation of code in C. Non-obvious parts of the code are explained in detail.

C program to remove comments from another C program

Comments in code are usually written for a better understanding of the code. But, these comments are dropped during the compilation process. This post concentrates on a C code which is able to remove all sorts of comments from another C program file.

Convert string case in C

While we write programs, often we come across places where the strings are required to be converted into one particular case, either upper case or lower case. This post discusses about different methods for converting case of fixed length null-terminated strings in C language.

C Shell - Simple history command implementation

The command history is a shell built-in, primarily used to view a list of commands, which have been executed before. The history command uses a file .bash_history, generally located in the /home/user/ folder for users other than root, and for root, the file is found in /root/. Well, a simple implementation of the history command in a shell, is discussed through with source code typed in C language.

C - Implementing a Circular Queue

A Circular Queue, also known as a Ring Buffer, is a First In First Out [FIFO] queue, having an upper bound but wraps around. This mean the queue is able to start from beginning when it reaches the end. Queues are generally implemented as Ring buffers, when there is a substantial limit for the number of elements that can be held at maximum.