Shadow Blade
Morrowland Presents Apron Tutorials
game - design - multimedia - web - programming - tutorials - There are currently viewers visiting Apron Tutorials.
   
 
TECHNICAL
GRAPHICAL
SOUND
GAME
WEB
ARTICLE
TOOL
PROJECT
 
 NEWS

  news

  history


 TECHNICAL TUTORIALS

  opengl

  direct3d

  c/c++

  visual basic

  java

  c#


 WEB TUTORIALS

  html

  dhtml

  asp

  php


 IMAGE EDITING

  photoshop

  draw sketch


 3D MODELING

  3d studio


 PROJECTS

  shadow blade

  game environment

  virtual 3d guide

  billy blue flame


 DEMOS

  win32 api


 ARTICLES

  general

  opengl


 COMMUNITY

  about us

  credit

  contact












#include <stdio.h>
#include <iostream>	
using namespace std;					


int main()
{	
	//Part I /////////////////////////////////////////////////////
	char myArray_1[3]; // declare an array myArray_1 of 3 integers
	
	myArray_1[0]= 'a'; // define myArray_1
	myArray_1[1]= 'b';
	myArray_1[2]= 'c';

	for (int i=0; i<3; i++)
		cout << myArray_1[i] << endl; // print myArray_1


	cout << endl;


	//Part II ////////////////////////////////////////////////////

	int myArray_2[10] = {0}; // declare myArray_2 (0 as default value)

	for ( i=0; i<10; i++)	
		myArray_2[i] = i; // define myArray_2
	
	for (i=0; i<10; i++)
		cout << myArray_2[i] << endl; // print myArray_2


	cout << endl;


	//Part III ///////////////////////////////////////////////////

	double myArray_3[2][2]; // declare a 2 dimansional array myArray_3
	double count=0;

	for ( i=0; i<2; i++)	
	{
		for (int j=0; j<2; j++)	
		{
			count++;
			myArray_3[i][j] = count * 11.1; // define myArray_3
		}
	}


	for ( i=0; i<2; i++)	
		for (int j=0; j<2; j++)	
			cout << myArray_3[i][j] << endl; // print myArray_3
		

	getchar(); // wait for a key to be pressed

	return 0;
}




/*

This tutorial demonsterates the use of arrays.
Arrays are a series of elements (variables) of the same type placed
consecutively in memory that can be individually referenced by 
adding an index to a unique name. 

*/



Download The Source Code! Download Visual C++ Source Code


I hope you found this c++ tutorial useful!

Don't forget to mention Apron Tutorials in your References!

Best Regards
Ronny André Reierstad

 LINKS

  morrowland home



 GAME DEVELOPEMENT

  nvidia

  gamedev

  polycount


 PROJECTS

  shadow blade

  game environment

  virtual 3d guide

  billy blue flame


 MATH AND PHYSICS

  mathworld

  physicsworld







PLEASE LINK TO


  All rights reserved Morrowland © 2011  
Ronny André Reierstad