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

TrueCrypt Free Open Source Encryption Software

Sunday, 10 February 2008 07:23

TrueEncrypt is a free open Source Encryption Software written in C++ programming language. If you haven't used TrueCrypt before but need to protect confidential information and documents then I can totally propose to use this Free Software. The latest version has the ability to encrypt the whole drive on windows operating system. So without the password (which you set to encrypt the drive), you can not run your windows operating system.

This free open source software is available for windows including (XP and Vista). It is also available for Linux and Mac OS X. Currently the software uses three types of encryption techniques. They are Whirlpool, SHA-512, RIPEMD-160.

One of the features of the software is to encrypt/decrypt the files on the fly. It means that the software can encrypt or decrypt the files in real time. An example could be a video file or a program setup file. When user double clicks on the files to run it, it is decrypted at real time and the program is run from the RAM. I have never seen any software before. I would suggest you to read through the Documentation section before you download the free program.

Here are the links you would be interested in.

 

Be the first to rate this post

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

Math.h library in C Programming

Saturday, 9 February 2008 07:21

Today I will try to explore math.h (library) header file provided to the programmers by turbo C++ compiler. Mostly people try to implement their own implementation of these functions; this is due to the lack of knowledge about Math library provided by turbo C++. So here we go.

Find the Square root of a number

Function: double sqrt(double); It calculates the positive square root of the input value which is given as double data type.

#include <math.h>
#include <stdio.h>
int main(void)
{
double dSqrtNumber = 36.0
double dSqrtResult;   
dSqrtResult = sqrt(dSqrtNumber);
printf("The square root of the number ");
printf("%lf is: %lf\n",  dSqrtNumber, dSqrtResult);
return 0;
} 

Find the Power of a number

Function: double pow(double x, double y) It calculates the value of xy . If both the values are 0 then the value returned by the function is 0. If the result is a more bigger number; which a variable of type double can not contain; then the function return an error (HUGE_VAL).

#include <math.h>
#include <stdio.h>
int main(void)
{
double dValuex = 5.0, dValuey = 5.0;
double dResult;
result = pow(dValuex, dValuey);
printf("%lf power %lf is: %lf\n", dValuex, dValuey, dResult);
return 0;
}

Find Ceil and Floor values

Functions: double ceil(double x); double florr(double x);

ceil() finds the smallest integer value of the value passed as the parameter, but the returned values is not greater than the values passed to the function. Where as floor() finds the largest integer value not bigger than the value passed as the parameter.

#include <math.h>
#include <stdio.h>
int main(void)
{
double dNumber = 50.54;
double dFloorValue, dCeilValue;
dFloorValue = floor(dNumber);
dCeilValue = ceil(dNumber);€
printf("Original number is:     %5.2lf\n", dNumber);
printf("Number rounded down %5.2lf\n", dFloorValue);
printf("Number rounded up   %5.2lf\n", dCeilValue);
return 0;
}

 

Be the first to rate this post

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

Microsoft Visual C++ 2008 Express Edition

Friday, 8 February 2008 07:19

Microsoft Visual C++ provides a dominant and flexible development environment for creating Microsoft Windows based applications. Microsoft has released the new version of Visual C++ 8. It is aimed at designing and developing Win32 and Win64 applications. It has a support for Game Creator which you can use to develop 2D and 3D games very easily. Microsoft has updated MFC with the new tools and libraries. Using this update to MFC, developers will be able to create applications with the “look and feel” of Microsoft’s Office, Internet Explorer and Visual Studio.

It also supports TR1, is the first major addition to the standard C++ library. The implementation includes a number of important features in VC++ language such as smart pointers, regular expression parsing, new containers (tuple, array, unordered set, etc.), sophisticated random number generators, polymorphic function wrappers, type traits and more.

If you are interested in Visual C++ 2008 Express Edition then you can easily download it and install the beta version. You have two options to download and install Visual C++ IDE. Either web install which will automatically download the VC++ Express which will automatically download and install the software. Or another option is to download an ISO image file with is the complete installation package.

You can read the Performance Improvements in Visual C++ and also read the MFC update where you can also comment on new Visual C++ 8. You can learn C++ programming as a .NET developer. These two tutorials will help you in starting C++ as a .NET Developer. Part 1 - Part 2

Be the first to rate this post

  • Currently 0/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
 
Copyright © by MYCPLUS. All rights reserved. #