Simple Array Tutorial

Published on: October 2, 2010

In this tutorial, I show you some basics about using Arrays in C++. Arrays are very simple when it comes to the basics and if you know it, you can get a lot done in a shorter period of time. The video takes you through some basics as well as shows you how it works as well as how to input and output data for arrays on the screen.

I will try to make another tutorial for Arrays where I go into using multiple array variables and output everything with and without sorting. It's very interesting and I hope you get to see it soon.

I hope you enjoy the video and if you have any requests feel free to let me know. Thanks for watching ! Thanks for watching and thanks for your supportand remember to subscribe!

Remember to checkout the Codesnip below to review the C++ code yourself! Feel free to copy the code, but I ask that you please provide credit if you leave the code unchanged when you use it.

Codesnip:

//Programmer: Nazmus
//Program:  Array Tutorial
//Website:  EasyProgramming.net

#include <iostream>
#include <string>

using namespace std;

int main()
{
 string name[5]; 
 int i;

 for(i=0;i<=4;i++){

  cout << "Please enter name: ";
  cin >> name[i];
 }

 cout << endl;

 for(i=0;i<=4;i++)
 {

  cout << name[i] << endl;
 }

 cout << endl;

 for(i=4;i>=0;i--){

  cout << name[i] << endl;
 }

 cout << endl;

 cout << name[2] << ", " << name[4] << ", " << name[0] << endl;

 system("pause");
}



Comments: