C and C++ Programming Blog
RSS Feed

Programming Mouse in C and C++

Monday, 18 February 2008 07:28

I was quite busy for the past few days in preparing some reports for my university, but was feeling a bit free today. I was thinking about what to write today. Having browsing throught the forums and few webpages I thought of writing about mouse programming in C and C++. I have written many programs, about programming mouse in C, before and explained the theory as well.

So what's today? Today I will provide some links about mouse programming and little description about those tutorials.More...

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Print pyramids and diamonds in C Language

Wednesday, 6 February 2008 07:17

I have been receiving lot of emails and requests through the forums and inline forums attached to the tutorials on my website C and C++ Programming Resources about how to print pyramids and diamonds in different formats. So I have written this article to demonstrate how you can print pyramids and diamonds using for loop and if condition. Building a pyramid in c programming is quite easy, but you must have the understanding of how for loop works.

Need the Source Code only - Click Here

Most people ask to print the diamond of the form below. but with slight modifications you can print any shapes you like and any thing you want. For example in the source I have commented few lines which print the numbers instead of the * to construct the diamons shape with numbers. Below is diamond which is actually constructed using two pyramids, one of them is upside down. Figure 2 explains it in more detail.More...

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

C Language Graphics Library Reference (part 3)

Tuesday, 5 February 2008 07:12

In the previous two posts I have discussed few important functions of graphics.h library in C Programming. As promised here is the sample function which will demonstrate the use of graphics functions and draw some nice shapes on the console. If you have followed the previous two posts the you will not find the source code difficult to compile and execute. If you still have any problems using the source code do let me know, and I will figure it out. If you are looking for more C Programming code then More...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

C Language Graphics Library Reference (part 2)

Monday, 4 February 2008 07:10

In the previous post I discussed few important functions mostly used to initialize and destroy the graphics mode in DOS environment. Today I will discuss functions to draw diferent shapes and lines. So here we go by starting the line function which is most important function in creating any graphics.

Function line

This function draws a line in the graphics mode.

void far line(int startx, int starty, int endx, int endy)

Function arc

This function draws an arc from start to the end point. It uses the radius and the angle inputted in the function parametsr. Function prototye is

void far arc (int x, int y, int start, int end, int radius)

Function bar

The bar() functions draws a rectangular bar on the screen. It takes four parameters of type int which are infact the points on the graphics screen, and fills the bar with the defined fill-pattern. Function prototye is More...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

C Language Graphics Library Reference (part 1)

Sunday, 3 February 2008 07:07

Graphics programming in C Language is discussed rarely. Today I will discuss some important functions of graphics.h in C programming Language and in the next coming article I will make a simple program to demonstrate the use of graphics functions. This is the part one of the article which discuses the important graphics function to create and destroy the graphics environment. In part two I will show you different graphics functions to draw shapes. And in last part I will add a sample program to demonstrate the use of graphics.h library. So let's start with the description of important functions and their use.

Below are the important functions and their description mostly used in graphics applications in C Language.

Function initgraph

This function is used to load the graphics drivers and initialize the graphics system. For every function, that uses graphics mode, graphics mode must be initialized before using that function.

void far initgraph(int far *driver, int far *mode, char far *path)

Path determines that path to the specified graphics driver. More...

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
 
Copyright © by MYCPLUS. All rights reserved. #