Playing with addresses of variables and their contents

Playing with addresses of variables and their contents: what is done by C with variables, addresses, and values. [sourcecode language=’cpp’] /******************************************************* * MYCPLUS Sample Code – https://www.mycplus.com * *...

Directory Structure

A small script to show all the Directories and Files in a specified Drive or Directory. It shows all the files/folders in a tree with the file size, last modified and other file attributes. It is just like the DIR/P command of the DOS. [sourcecode...

Calculate the SUM

This C Language program reads a sequence of positive integers from the console, given by the user, and prints them out together with their sum. Use a Sentinel value (say 0) to determine when the sequence has terminated. So wehenever the user will enter 0 the program...

Copying one file into another

Similar to Unix’s cp command. This program will be called with two parameters, the names of two files. It copies the second to the first. [sourcecode language=’cpp’] /******************************************************* * MYCPLUS Sample Code...

Borland C/C++ compiler Interface

This is a Borland C/C++ compiler Interface using the graphics.h library. This program uses many functions of graphics.h library provided by C Language. like line(), setcolor(), outtextxy() etc… You can play around with this code to learn how to make simple and...

Linked List Demo

A small linked list traversal program to show the basics of linked lists. C /******************************************************* * MYCPLUS Sample Code - https://www.mycplus.com * * * * This code is made available as a service to our * * visitors and is provided...

Small Help Dialog

A small help dialog in DOS mode graphics. It can b used in any application for help purpose or showing messages to the user. It uses the ASCII characters to build the windows shpe and then I have used the gotoxy() function to place the cusror at that location to print...

Enumerated type variable

Example that uses an enumerated type variable. This example uses enumerated type is used in C++ in exactly the same way it was used in ANSI-C with one small exception, the keyword enum is not required to be used again when defining a variable of that type, but it can...

Tree manipulation and traversing

Nice tree manipulation and traversing C /******************************************************* * MYCPLUS Sample Code - https://www.mycplus.com * * * * This code is made available as a service to our * * visitors and is provided strictly for the * * purpose of...

Graphics

Small C Language Program to show the drawing and filling of some basic shapes like rectangle, circle etc… with colors and different shades. First of all I have created a characters aray of patterns that will fill the drawing, then initialize the graphics mode...

Defensive Programming Techniques

Writing perfect software may be an elusive Holy Grail for developers, but a few defensive techniques, routinely applied, can go a long way toward narrowing the gap between code and ideal. Nothing will give you more peace of mind than thoroughly tested code. If...

Data Time and Year

Starting to use enumerated types: Printing for each day of the week, today, yesterday, and tomorrow, both as a string and as a number. C /******************************************************* * MYCPLUS Sample Code - https://www.mycplus.com * * * * This code is made...