Viewing 36 to 42 of 50 items
Archive | C++ RSS feed for this section

Advanced Control Flow – The Do While Loop

The Do While Loop is a loop that guarantees execution of the statements within the loop at least once. The structure of the Do While Loop Below is the structure: do { //statements } while ( condition(s) ) ; What is this useful for? In order to execute a set of commands at least once.

0

Introduction to Functions

Functions allow you to perform the same operation on many inputs with one simple call. Why a function anyways? First of all, let’s see how we’d perform a certain task without one. How would we print out the entire contents of a vector each time we modified it? Let’s show how we would do it  Full Article…

0

Simple Data Structure – The Vector

The vector is a simple data structure that allows you to store values with the same data type in one container. Introduction Without the use of a data structure, how would you store multiple variables? Let’s say we wanted to store 5 names into strings. How would this be done? string name1,name2,name3,name4,name5; cin >> name1  Full Article…

6

Basic Control Flow Continued

By this time you should be familiar with the basics behind If and Else if statements. Below you’ll see more examples and more ways to use Control Flow in your programming. 1. You’ll learn more advanced ways of manipulating control flow in your program. 2. You’ll also learn how to declare and initialize boolean variables.  Full Article…

0

Basic Control Flow

In the following tutorial, you’ll learn how to use if, and if-else statements. They are useful for deciding on what lines of code to execute based on values of previous variables in your program. The If Statement An example is as follows int x; if ( condition ) x = 50; //If condition returns TRUE,  Full Article…

0