C/C++ Tutorial

Prototyping in C++

Introduction: This tutorial is on how to use Function Prototyping in C/C++. Function File: Here is a basic function file which, after running the 'int main' function, runs a custom function named 'calculate' which returns an integer and is output to the screen.
  1. #include <iostream>
  3. using namespace

C++ Tutorial: Math class in C++/CLI. Function calculator

   In this tutorial we are going to talk about Math class in Visual C++/CLI and we will use such methods : Math::Sin (computes sine), Math::Cos(computes cosine), Math::Tan (computes tangent). And also we will write a simple program, which computes some math functions. Preparation    First of all you need to create a new Windows Forms Application project and prepare your main form for coding. In this program should be one Text Box, four Radio Buttons, two Labels and one Button Control. You can situate them as you want; the example of design of my program is above.

C++ Tutorial: Using a Link Label Control in C++/CLI

   In this tutorial I am going to show you one more control – Link Label. This control is little similar to Label Control – it represents text. But if you click on the text of Link Label control you can go to a specific location, for example to the page in the internet. In the program of this tutorial we will make an opportunity for user to choose the browser and the page to surf the World Wide Web. Preparation    First of all you need to create a new Windows Forms Application project. Prepare main form by dragging controls on it.

C++ Tutorial: Multiplication Checker. Random in C++/CLI

   Today we will talk about random numbers in C++/CLI. Also I will show you a simple program, where I have used random numbers generator. First of all I should tell some words about the program. The main purpose of it will be to check your math knowledge in multiplication. It will generate two random numbers and you should multiply them and write the result. If the result is correct, program will show you the message “Correct”.

C++ Tutorial: Learn ComboBox Control in Visual C++

   In this tutorial we will talk about Combo Box control in Visual C++. Also we will make a simple program for basic arithmetical operations: addition, subtraction, multiplication and division.    First of all, let`s see what is Combo Box control. Combo Box control is little same to Text Edit, but it has one more option. You can add some constant values to be used in this control. While your program is running, you can choose one of your constant values and after that this value will be as the value of this control. It is really comfortable than you need to help user to choose option needed.

C++ Tutorial: Status Strip Control in C++/CLI

   Today we are going to talk about such component in Visual Studio 2012 as Status Strip. With component is mostly situated at the bottom of the main form and it shows progress of some event, warnings, errors or other additional information. In today’s program we will use this component. Preparation    You need to create new Windows Forms Application project. Then drag Status Strip component on the form and will be added to the project. After that click on it and choose two components from the popup dialog – Progress Bar and Status Label.

C++ Tutorial: Simple Text viewer

   The program for today is text viewer. It works this way – you click on a button, then you choose a file with *.txt extension, after that you click “Open” and you can see all file in your main form. For coding this program we will use Borland C++ Builder 6. Preparation    First of all create new application. On the main form put such controls as Button, Rich Edit control and OpenFile Dialog. After you have done that you need to configure properties of Rich Edit control. Go property called “Lines”, click on button with ‘…’ and delete all lines.

C++ Tutorial: Make Simple Picture Viewer

   In this tutorial we will make a simple program called “Picture viewer”. This program will open a selected picture or image and it will be shown on the main form of the program. In the process of coding of this program we will use Open File Dialog component and Picture box component. Preparation    First of all you need to create a new “Windows Forms Application” project. Then you need to put a Picture box component and Button component on the form. After that you also need to add Open File Dialog to the project.

C++ Tutorial: Change the Color and the Font of the Label

   In previous tutorial we have changed the background color of our main form. Today we are going to continue learning Dialog components. In this tutorial we will change the font of the label using Font dialog component and the color of the text using Color Dialog, which we used in previous tutorial. Preparations    The view of form is very simple. It consists of a label control and two button controls. First button will modify the font of the label and the other will modify the foreground color of the same label.

C++ Tutorial: Change the back color of the form using Color Dialog component

   In this tutorial we will learn some useful things about Color Dialog component in C++/CLI and make some practice. We will write a simple program, which will change the back color of the main form of our application. Also we will do some magic with buttons of this dialog :). So, let`s begin. Preparations    First of all you need to start a new Windows Forms Application project and put on it control called button. Then find the Color Dialog control. It situated in the group of controls called “Dialogs” and drag it on the form.