Saturday, December 29, 2012

Using OpenCV in GTK sample program "Inverting an image on Image Processing"

In this article I want to show you How we can use the OpenCV on GTK (GIMP toolkit) on fedora.Although GTK+ is a GNU project like the GMP, it is released under the terms of the more liberal LGPL(lesser general public license) that permits software (including closed source proprietary software) to be written using GTK+ without payment of fees, royalties, or other restirictions. The freedom offered by the GTK+ license is in contrast to its competitor QT(you must instead purchase a commercial Qt license in that case).
This program is compile using gcc compiler on fedora. At first you need to install the gtk and gnome on your machine.
In fedra that use RPM packages, you should have at least install the following RPM package.
$  su

$  yum install gtk2
$  yum install gtk2-devel
$  yum install gtk2-engines
$  yum install libgnome-
$  yum install libgnome-devel
$  yum install libgnomeui
$  yum install libgnomeui-devel

Now its time to install OpenCV package.

Using semaphore to synchronize the multiple thread using c on linux/fedora

Semaphore is a new type of variable introduced by E. W. Dijkstra. You may learn about semaphores in university. It is used to solve the Producer-Consumer Problem in Operation system design which I have learn in books "Modern Operating Systems " (second edition) by Andrew S. Tanenbaum. In that books the algorithm for semaphore is clearly defined and easy to understand. But I was always curious about that "Does this type of problem occur on our program?" rather than operating system design and "Where can I use it?". When I begin to learn linux programming I found the semaphore function under <semaphore.h> header and example program where semaphore is used to synchronize the thread.
In this article we look at the simplest type of semaphore, a binary semaphore that takes only values 0 or 1. There is also a more general semaphore that takes a wider range of values. Normally, semaphores are used to protect a piece of code so that only one thread of execution can run it at any one time.The semaphore functions do not start with pthread_,as most thread-specific functions do,but with sem_. Four basic semaphore functions are used in threads. They are all quite simple.

Friday, December 28, 2012

Threads Program using c on linux/fedora


This program creates a single extra thread, shows that it is sharing variables with the original thread, and gets the new thread to return a result to the original thread. Multithreaded programs don't get much simpler than this.
Lets look the function which create the thread. pthread_create creates a new thread,much as fork creates a new process.
#include<pthread.h>
int pthread_create(pthread_t *thread, pthread_attr_t *attr, void(*start_routine)(void *), void *arg);
The first argument is a pointer to pthread_t . When a thread is created, an identifier is written to the memory location to which this variable points.This identifier enables you to refer to the thread . The next argument sets the thread attributes. You do not usually need any special attributes, and you can simply pass NULL as this argument. Later is the chapter you will see how to use these attributes. The final two arguments tell the thread the function that it is to start executing and the arguments that are to be passed to this function.

Tuesday, December 25, 2012

Bash Shell Scripting example project "library management"



This program is a sample shell script. To understand this project you must know the basic syntax of shell programming. In this article I tried to show an example how we can use a shell as a programming language. I have build the very simple shell script for managing a library books. If you are completely new to shell programming in Linux then at search the following topic on Google about their syntax and uses before proceeding this article. List of topic are:
  1. variables
  2. if condition
  3. switch case
  4. printf ,read , echo command
  5. while loop, for loop
  6. grep command
  7. function declaration
Now if you have learn above topic in shell programming then you can understand this project library management. In this project simple features are included like adding books, editing books information,remove and search books and view all books. Lets start the project.

Saturday, December 1, 2012

Creating Static Libraries using c on linux Fedora.

You have seen the library file  ".lib" extension on Windows and a ".a" on LINUX/UNIX.If you are unknown about what are they and how to create them then you will get answer here.
These are Static Library files, also known as archives, which are simply a collection of ordinary object files. It is a set of routines, external functions and variables which are resolved in a caller at compile-time and copied into a target application by a compiler, linker, or binder, producing an object file and a stand-alone executable. Simply we can say it permit users to link to programs without having to recompile its code, saving recompilation time.
There are several advantages of static libraries:
1.The most significant is that the application can be certain that all its
    libraries are present and that they are the correct version. This avoids
    dependency problems.
2. Result in a significant performance improvement.
3. Can be shared between many applications leading to space savings.
4. It also allows the library to be updated to fix bugs and security flaws
    without updating the applications that use the library.

Friday, November 16, 2012

Start learning C on Linux (Fedora)

We students learn c on windows . We create the executable file (.exe) using turbo c or gcc compiler that runs only in windows machine. Have you tried the c on Linux and generating executable file for Linux? Not yet then follow this article.
In this article you learn how to:
1. Install  linux (e.g fedora or ubuntu)
2. Install  gcc compiler in fedora
3. Compile the c program using gcc.
You will also understand what are the executable file in Linux.

Saturday, August 4, 2012

C project on Medical Store Management System with source

This is large and complete c project built for medical store management system. In this project you can keep details of customer , suppliers and medicine. You can view the report and billing information also. You can add,edit, delete and search the record also. This project is also console application without graphics compile in code::blocks IDE with MinGW compiler.
Whole project is completely based on file handling all the record are store in file. You learn how to store the data ,editing data, searching data and deleting data using file. You can see the following feature in this projects.
1. Supplier Info
2.Customer Info
3.Medicine
4.Report
5.Bill

Employee’s Management System Project in c++ with source

This is another Mangagement project which is suitable for school or college mini project. It is written in c++ language in code::blocks IDE with MinGW compiler. It is console application without graphics. Whole project is completely based on file handling all the employee’s record are store in file. You learn how to store the data, editing data, searching data and deleting the data using file. Following features can be found in this project which is listed below.
1. Built The Employee table
2.List the employee table
3.Insert new entry
4.Delete an entry
5.Edit an entry
6.Search a record
7.Sort the table

Thursday, July 19, 2012

Project on Visual C++::Server to Exchange Data between text file and Excel

In this program we use Dynamic Data Exchange (DDE)  with Notepad and Excel. Using Visual C++ a DDE communication server is made to exchange date. If we change the any data in Notepad then automatically data is updated in Excel. By same way we can also use Dynamic Data Exchange with Word and Excel. When possible, it is recommended that you use Automation, not DDE, to communicate with Excel or Word. DDE is a old method or technology. Excel and Word have rich object models that provide functionality through Automation that is not available with DDE. Excel versions 5.o and later , and Word versions 7.0 and later, support Automation. But who are using old version of Excel where Automation is not supported then DDE can be a better solution. I can't explain the program and DDE better than MSDN site so I will provide the reference link where you can learn it . 

Wednesday, June 27, 2012

C++ Project Bus Reservation System in Code::blocks

“Bus Reservation System” project is written in c++. It is very simple project just to show the implement of class and object of C++. You can understand the code easily and learn how to create class and use object in c++ for your C++ project.The tasks that user can perform in this project are listed below:
1.Install the bus record
2.Reservation
3.Show the bus details
4.Show all buses available
This project is console application without GUI. You can add many features in this project.Here data of bus information is not store in file so every run of program previous data is lost so you can implement the file handling to store all the bus details.

Code::blocks Project Bank Management System in C programming

Bank Management System project is design and programmed by Ravi Agrawal, Sagar Sharma and Sawal Maskey student of IOE as a first year mini project in c. This program may not be used as a Banking software but programmer tries to implement all the features of Bank. Program is completely password protected and has a two mode Admin and Staff mode. Bank administrator can login as admin user name is “admin” and password is “ioe” for admin mode. For staff mode three  user name is available which is written in USER.DAT which you can see download this project. The list of user name and passwor for staff mode is given below: 

School Project Personal Dairy Management in C programming

This project is also a console application written in c as a 1st year college Mini project “Dairy Management”. It is created by Bijay Puri, Bhanu Poudel and Nripash student of IOE. User can keep the their personal record in this program. We can also keep records of the duration of tasks,time and date. All the data is stored in the file.
You can make this program as a reference for your project . All source code is available and compiled in gcc compiler and code::blocks IDE.
All the tasks that we can performs are listed below:-
MAIN MENU:
1.ADD RECORD
2.VIEW RECORD
3.EDIT RECORD
4.DELETE RECORD
5.EDIT PASSWORD
6.EXIT
Download Project from GitHub

Telecom Billing Management System in c with source code

This Mini project is compile in gcc compiler with code::blocks IDE. This project can be a good reference for those student who are doing there school project in c.Architecture of this project is very simple and easy to understand the code. Just file handling is used to store the data and corresponding function are made to manipulate the data.
The tasks provide in this program are:-
1. A : for adding new records.
2. L : for list of records.
3. M : for modifying records.
4. P : for payment.
5. S : for searching records.
6. D : for deleting records.
User are provide the above tasks.They can add records,modify and view records. Searching and deleting facilities is also provided.

Download Project from GitHub


Saturday, June 23, 2012

Collection of C# Windows Form application projects with source code

Here are the lists of some of the windows form application projects in c# which helps you to learns GUI application development with windows form. It is the  platform for Microsoft Windows application development, based on the .NET Framework. This framework provides a clear, object-oriented, extensible set of classes that enable you to develop rich GUI application. 
We can design graphical user interface very easily other than complex C++ library with the help of window form. All the project are built in Enterprise visual studio 2010. If you don't have Enterprise edition then you can download the express edition of visual studio for c# development.
Here are the lists of projects:
  1. Calculator program
  2. Image Viewer
  3. Maze Game
  4. Math Quiz Game
  5. Matching Game
  6. Drawing Basic Shapes
  7. Pixel Plot on Form
  8. Solar System Simulation with SharpGL
  9. Z Buffer Algorithm for visible surface detection
  10. Projecting 3D into 2D Perspective

Tuesday, June 12, 2012

3D Solar System Simulation graphics project in SharpGL(OpenGL for C#)

I have work in this project “3D Solar System Simulation” as a graphics course. It may not be accurate as our solar system but perfect for learning OpenGL in c#(SharpGL). For accurate simulation we have to do little research effort which I haven’t time to do so. I have created this within one week and provide the platform for simulation of solar system. All eight planet revolve around the sun in elliptical path and also rotated about their own axis. You can see my technique how I make the possible  for rotation in its own axis and revolution around the sun simultaneously. There are some limitation in this project which I will discuss below.You can also download the complete project with source code from below.
The requirement to run and learn this project:-
  1. Os windows 7 and visual studio IDE
  2. You must add the template for SharpGL
  3. Basic knowledge of OpenGL ,C# and windows form.

Tuesday, May 29, 2012

Simple method for texture mapping on sphere Using gluSphere and gluQuadricTexture in OpenGL

In my previous article [here] I have shown you how to map texture in solid sphere. In that method whole sphere is render using triangles and providing texture co-ordinates which seems difficult to understand. Now in this article I am going to show you simple method to map texture on Sphere. We first draw a sphere using gluSphere and texture co-ordinates are automatically generated by gluQuadricTexture function for Sphere.
gluSphere:
syntax:
void WINAPI gluSphere( GLUquadric *qobj, GLdouble radius, GLint slices, GLint stacks);

Wednesday, May 9, 2012

Creating multiple windows with OpenGL and GLUT

We may need the multiple OpenGL windows for our program for example we can show orthographic view of object (top view, side view,front view)  in separate  windows.
Steps for Creating Multiple Windows:-
1.Initialize drawing context and frame buffer using glutInit(), glutInitDisplayMode(), and glutInitWindowSize().
2.Create first window
3.Register callbacks for first window
4.Create second window
5.Position the second window
6.Register callbacks for second window
7.Register (shared) idle callback
8.Enter the main loop
Note: Callbacks can be shared between windows, if desired



Saturday, April 28, 2012

Texture mapping in SharpGL (OpenGL in C#) sample program for windows form

At first you have to setup the SharpGL in Visual Studio for that you can follow my previous articles create SharpGL project in c# .
OpenGL bind the texture form the texture memory which do not store arbitrary images but a texture has specific constraints on the images. So,OpenGL function for texture is same whatever be the library we used for e.g GLUT,SharpGL,GLFW only the difference is how we load the images on the texture memory. These images are store in different file format , which required the program to decode and load the images form file into texture memory and this is painful effort for the programmer to write there own decoding and loading code.
In GLUT  texture  mapping example is shown in this article Texture mapping in GLUT where you can see BMP image is loaded at first in the memory and that texture memory data is used by OpenGL function for texture mapping but in GLFW we don’t have to write code for loading image from file it provide the built in function for loading image from a Truevision Targa format file (.TGA) and here is the sample project Texture in GLFW.
Now in SharpGL texture is not so difficult. We can create the Bitmap object by loading BMP image file and all the information of image can be used with this Bitmap object.

GLFW Tutorial 4: Texture mapping sample code in OpenGL Framework

If you are new to the GLFW(OpenGL framework) you can follow beginning tutorial here.
On Contrary with GLUT texture mapping is very easy in GLFW . We want to use pre-generated 2D images for surface textures, light maps, transparency maps etc.These images are stored with a standard image format in a file, which requires the program to decode and load the      image(s) from file(s), which can require much work from the programmer.To make programming easier for OpenGL developers, GLFW has built-in support for loading images from files.
In this tutorial I give example for surface textures only. Surface textures are important because it helps to make object realistic.
To load a texture from a file, you can use the function glfwLoadTexture2D:
int glfwLoadTexture2D( const char *name, int flags )
This function reads a 2D image from a Truevision Targa format file (.TGA) with the name given by name, and uploads it to texture memory. It is similar to the OpenGL function glTexImage2D, except that the image data is read from a file instead of from main memory, and all the pixel format and data storage flags are handled automatically. The flags argument can be used to control how the texture is loaded. If flags is GLFW_ORIGIN_UL_BIT, the origin of the texture will be the upper left corner (otherwise it is the lower left corner). If flags is GLFW_BUILD_MIPMAPS_BIT, all mipmap levels will be generated and uploaded to texture memory (otherwise only one mipmap level is loaded). If flags is GLFW_ALPHA_MAP_BIT, then any gray scale images will be loaded as alpha maps rather than luminance maps. To make combinations of the flags, or them together (e.g. like this: GLFW_ORIGIN_UL_BIT |GLFW_BUILD_MIPMAPS_BIT).
Here is the sample program to illustrate the texture mapping with complete source code written in c++ with gcc compile and code::blocks IDE. You can also download the project file.

Saturday, April 21, 2012

Create SharpGL/OpenGL for C# Project in windows form application

SharpGL is a C# OpenGL Class library . SharpGL 2.0 is a powerful library that allows you to use OpenGL in your managed applications. Some of the top features are:
  • Full support for all OpenGL functions up to OpenGL 4.2
  • Full support for all commonly used OpenGL extensions
  • Support for WinForms applications
  • Support for WPF applications (without resorting to WinForms hosts)
  • A powerful scene graph including polygons, shaders, NURBs and more
  • Many sample applications as starting points for your own projects.
  • Visual Studio Extension with SharpGL project templates for WPF and WinForms.
Its Class libraries are
  • SharpGL - Contains the main OpenGL object - this object wraps all OpenGL functions, enumerations and extensions.
  • SharpGL.SceneGraph - Contains all wrappers for OpenGL objects and Scene Elements - Lights, Materials, Textures, NURBs, Shaders and more.
  • SharpGL.WinForms - Contains Windows Forms Controls for your applications.
  • SharpGL.WPF - Contains WPF Controls for your applications.
  • SharpGL.Serialization - Contains classes used to load geometry and data from 3D Studio Max files, Discreet obj files and trueSpace files.

Tuesday, April 17, 2012

GLFW(OpenGL FrameWork) tutorial 3:Transformation:Translation,Scaling and Rotation.

If you are beginner to OpenGL FrameWork (GLFW) visit my previous tutorial lesson Here so that you can understand in details.Translation ,Scaling and Rotation of object is so easy because OpenGL provide these command to us we don’t have to write our own  Transformation matrix.

Translation command:

Translation is movement along any of the three axis in a 3D scene, for example, moving something the left is a translation on the X axis if you are looking straight on.
Command:
glTranslatef( xValue, yValue, zValue );
e.g:
glTranslate(5.0, 0.0, 0.0);
This translate the scene five unit along positive x-axis. One things you must remember ,all the scene drawn below this command will be translated.
So,if you want to translate only one object then you have to restore the transformation. Restore can be done by putting drawing scene and translation command between glPushMatrix() and glPopMatrix() .

Monday, April 16, 2012

GLFW (OpenGL Framework) tutorial 2: Drawing Basic Shapes

Lets first discuss how OpenGL does. Describing co-ordinates system of OpenGL, center of co-ordinate is middle of widow, positive x-axis is pointed towards right and negative x-axis toward left ,positive y-axis is pointed towards up and negative y-axis towards bottom , positive z-axis is pointed towards outside of screen and negative z-axis towards inside the screen.
  • coord_system
OpenGL draw object similar to our eye . By default eye is in origin and we are looking toward negative z-axis.

GLFW tutorial 1:Introduction to OpenGL Framework

Welcome to codeincodeblock.blogspot.com I have created this tutorial for 3D programming in OpenGL for beginners. OpenGL has wide range of use some of them is Gamming ,simulation, virtual prototyping. This tutorial provide only basic knowledge of OpenGL in brief with full source code and complete explanation so, that you can move quickly to advanced OpenGL programming. All tutorials is written in c++ so that you must know the basic c++ to understand this tutorial.
We use OpenGL for 3d programming. You may wondering what is OpenGL. OpenGL is software interface for graphics hardware in other word we can say it is language translator so that we can use only one language for different graphics hardware. OpenGL is hardware independent. We can draw both 3D and 2D stuff. For 2D their are better libraries like SDL ,Allegro. We use OpenGL basically for 3D stuff.
I use GLFW library and code::blocks IDE. You may confused reading OpenGL and using GLFW library, what does GLFW means? The creation of a window to render stuff in is not covered in the OpenGL specification. This is handled by platform-specific APIs. GLFW is one of this  APIs. It is a crossplatform windowing and keyboard/mouse/joystick handler. Contrary to GLUT, this is more aimed for creating games. Supports Windows, Mac OS X and Unix-like systems such as Linux and FreeBSD.
You don’t have code::blocks IDE then download it form Here .There are two options of download so, choose codeblocks-10.05mingw-setup.exe file in which MinGW compiler is already install. Then you need to setup the GLFW library in code::blocks. Follow my previous article Setup GLFW Project for setup.
Now you are ready for OpenGL 3d programming..
Goto tutorial 2 Drawing Basic Shape

Friday, April 13, 2012

List of Top Ten College Mini Projects in c/c++ with full source code

If you need to make a Mini project in c/c++ language and you are confused in project topic then don’t worry here is the list of Top 10 Mini Projects in c/c++ you can choose any one of them. Source code of all projects is also available .All the projects are compiled in gcc compiler with code::blocks IDE so some projects may create error in different compiler like Turbo c/c++. If you are using Turbo c then choose another compiler it is old compiler. Best one is gcc/g++ compiler for c and c++.
All projects are collected by college friends and me. Some of the project are also edited to run in gcc compiler with code::blocks IDE from other website. For your query and suggestion send me mail at smokindinesh@gmail.com.
 Projects in C++ 
1.Student database system
2.Hang Man
3.School fee enquiry Management System
4.SuperMarket Billing System
5.3D Bounce in OpenGL
6.Bus Reservation System
7.Puzzel Game in wxWidget
8.Data Exchange between Notepad and Excel (Visual C++)
9.Employee's Management System

Projects in c
1.Libray management
2.Snake Game
3.Quize Game
4.Department store system
5.Tic-tac-toe game
6.Personal Dairy Management System
7.Telecom Billing Management System
8.Bank Management System
9.Contacts Management
10.Medical Store Management System


Other
Project on C# Windows Form Application
1. List of C# Windows Form Projects

Top Collection of Mini Projects
1. Top 10 C/C++ Project

College Project Repository
1. Flipkarma


visible surface detection z-buffer algorithm in computer Graphics sample source code

This article is extension of my previous articles Projecting a 3D world co-ordinates into 2D perspective where I have drawn wireframe cube in perspective view. If we want to draw a solid object then we must decide the visible surface to render. The surface/object which we render at last that will display on screen irrespective of depth and can overwrite the nearest surface/object. So, we must implement the special method to find  out the visible surface and one of them is z-buffer method.
z-buffering is the management of image depth coordinates in three-dimensional (3-D) graphics, usually done in hardware, sometimes in software. It is one solution to the visibility problem, which is the problem of deciding which elements of a rendered scene are visible, and which are hidden. The painter's algorithm is another common solution which, though less efficient, can also handle non-opaque scene elements. Z-buffering is also known as depth buffering.
When an object is rendered, the depth of a generated pixel (z coordinate) is stored in a buffer (the z-buffer or depth buffer). This buffer is usually arranged as a two-dimensional array (x-y) with one element for each screen pixel. If another object of the scene must be rendered in the same pixel, the method compares the two depths and chooses the one closer to the observer. The chosen depth is then saved to the z-buffer, replacing the old one. In the end, the z-buffer will allow the method to correctly reproduce the usual depth perception: a close object hides a farther one. This is called z-culling.

Saturday, March 3, 2012

Projecting a 3D world co-ordinates into 2D perspective projection Algorithm in c# windows form with source code

We imagine the object in 3D co-ordinates but drawing these object on computer screen we must have to do 2D screen projection. There are different types of projection like parallel ,oblique ,perspective and here I will show you perspective projection. I will try to describe all the procedure that transforms points in 3 dimensional space to screen coordinates given a particular coordinate system, camera and projection plane models.This discussion describes the mathematics required for a perspective projection including clipping to the projection pyramid with a front and back cutting plane. Here projection plane is perpendicular to the view direction vector so,oblique projection is not allowed.

You can download complete project from GitHub.

3D Co-ordinates System
It has the positive x-axis to the right, the positive z-axis upward, and the positive y-axis forward on the screen and origin is in middle.

Wednesday, February 15, 2012

Fastest method for pixel plot in windows form application using c sharp sample example

In my previous articles I have shown you how to draw a pixel in picture Box. In that method we have drawn pixel directly in control of picture Box so it was slow method. Here I am presenting the fastest method to draw a pixel. For this technique we first draw a pixel or bitmap in memory then only we load it in out picture Box.
Now lets start a project
1. Create a windows form application in c sharp and give project name fastPixelPlot or your choice.
2. Set the the form properties WindowState to maximized from properties window
3.Add pictureBox on a form from toolbox
4.Set pictureBox properties Dock to fill from properties window
I assume your form name is Form1 and pictureBox name is pictureBox1

Download complete application from GitHub.

Sunday, February 12, 2012

Delay function in codeblocks

In code block you can use
Sleep(unsigned int miliseconds);
function for delay in execution.
delay(unsigned int miliseconds) function is used in turbo c. For codeblocks you have to add code which is given below example:
#include<stdio.h>
#include<time.h>
void delay(unsigned int mseconds)
{
    clock_t goal = mseconds + clock();
    while (goal > clock());
}
int main()
{
    int i;
    for(i=0;i<10;i++)
    {
    delay(1000);
    printf("This is delay function\n");
    }
    return 0;
}

Saturday, February 11, 2012

Drawing a basic shape in windows form application using C#

There consists of the set of .NET base classes that are available to control custom drawing on the screen.Here we learn how to draw basic shapes in windows form using C#. This articles is simple collection which I read while doing graphics projects.
Before starting create a new project in windows form application using C# and I assume that your name of form is Form1. Increase the size of form up to 720*600 in properties windows.Now we draw a shapes by creating graphics object and pen or brush object and these class are from namespace system.Drawing.
At first we have to initialize the paint event handler by adding
this.Paint += new System.Windows.Forms.PaintEventHandler(this.MainForm_Paint); 

line of code in Form1.Designer.cs inside private void InitializeComponent() method. If you don’t do this  then your image won’t draw in form although compiler doesn’t shows any error.

Tuesday, February 7, 2012

Drawing pixel directly in windows form using c# and implementing DDA Algorithm to Draw a straight line.

In windows form application pixel operation method is different then C++ builder.There may be many techniques to Draw single pixel and one of them I have presented here.Usually in windows form, code is generated by IDE using drags and drops controls which is specifies by the System.Drawing namespace.We can also draw basic shapes and curve by creating graphics objects and pen objects to paint a various shapes. We will create graphics object but not pen object because we won’t draw a basics shapes only draw pixels.

Friday, February 3, 2012

Draw a 3D Rubik cube using OpenGL utility toolkits GLUT with source code

This article is similar  to my previous article drawing 3D chess board.To make Rubik cube real I have used texture mapping.At first I draw a one cube where I mapped texture in all six side of cube with six different color images and you can save these images from here.After that 27 cube is drawn by looping and final Rubik cube is drawn, rotating in (2,2,0) axis.For texture mapping we have to write a code to load a images and store a value of (R1,G1,B1,R2,G2,B2,……………)pixels in pixels array.In this project there is a Image class where you can see in source code below in file name imageloader.h and imageloader.cpp which I have take from a website www.videotutorialsrock.com.
All the images for this program is given below save it in your project file location.

Saturday, January 28, 2012

Mini project student database system in c++ source code download

This is simple student information system project.Wher you can do following things 1. Add    Records
          2. List   Records
          3. Modify Records
          4. Delete Records
          5. Exit   Program
to store data file is used. Download project from GitHub.

How to display a system date and time using c++

#include <ctime>
#include <iostream>
using namespace std;
 
int main() {
    time_t t = time(0);   // get time now
    struct tm * now = localtime( & t );
    cout <<  now->tm_mday << '-'//day
         << (now->tm_mon +1 )  << '-'//month
         << (now->tm_year +1900 )//year
         <<endl
         <<now->tm_hour//hour
         <<'-'<<now->tm_min//min
         <<'-'<< now->tm_sec//sec
         << endl;
 
         return 0;
}

Wednesday, January 25, 2012

Mini project Hang Man in C++ source code download

It is a simple project just to provide a Hang Man game concept.In this project I haven’t draw a man for a wrong choice so,try to draw a simple man by using “|” pattern in your project which make your project better .
Here is the source code ,copy and compile it in Code::blocks gcc compiler or Download project from GitHub.

Mini project school fee enquiry management system in c++ source code download

This mini project is written by my friend in C++ which is simple console application without graphics.This is a fee structure program It can be used for following ways:-
1.We can  view the fee slip of a student of a class
2.We can also Modify the fee structure of the school
3.And View the fee structure of the school in the form of alist
The menu functions are described as follows
1. FEE SLIP:  This function displays the fee slip for a givenstudent
from the class entered by the user.
2. MODIFY:    This function modifies the fee structure for a give class.
The user can change the fees for various fields
3. LIST:      This function displays the list of total fees for all the
Here is the source code ,copy and compile it in gcc compiler with code::blocks IDE or Download project from GitHub.

Mini project supermarket billing system in c++ source code download

This mini project is written in C++ where you find mainly two classes one class item another class amount and class amount is inheritance form class item.It is simple console application without graphics. From this project you learn file handling in c++ and use of stream class.And main defect of this program is that goto label  is used to jump form one menu to another menu and separate function for editing  and deleting items are not used.So,if you want to make it your school project or college mini project then modify it ,make separate function for editing and deleting and also try to use while loop instead of goto label .Any suggestion and help for this project is appreciated .
Here is the source code ,copy and compile it in gcc with code::blocks IDE or Download project from GitHub.

Saturday, January 14, 2012

Star pattern program in c source code

1.Print a pattern
         *
      *  *
   *  *  *
*  *  *  *
To print this pattern we have to use three for loop.Inside the first loop there 
will be two loop, one is for controlling the spacing factor and another for 
printing the stars.Constant value of First loop is used in second inner loop to
decided the number of stars.
Here is the source code copy and paste it on code::blocks and run the program you
will see the result.