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











  Alternative 1:


#include "stdio.h"// we need to include some external files
#include <iostream>
using namespace std;

int main() // the main function (called when you execute your program)
{
	cout << "Hello Neo...\n";		// print to screen

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

	return 0;				// the main function returns zero
}




  Alternative 2:


#include "stdio.h" // include our standard input/output header file

int main() // the main function (called when you execute your program)
{
	printf("Hello! Please press a key to continue.\n"); // print to screen

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

	return 0;		// the main function returns zero
}




/*

first you must include the necessary files to be able to use cout
#include 	
using namespace std;

stdio header file is necessary to use getchar()
#include 	

all c and c++ programs must have a main function the main function
is the first function that run when the program is executed

void main()
{


}

void means empty, main is the name of the function.
"{" starts the function "}" ends the function.

when coding in linux the main function needs to return a value
int means return an integer, in this case zero

int main()
{

	return 0;
}

you will learn more about functions in the function tutorial.

*/

// end commands with ";" in c and c++

// comment your code by using slashes //my comment

// commment out a whole block by using: /* and */
/*
my comment line 1
my comment line 2
*/
 

// cout <<""; will print out the text for you 


// to get a line break use  endl or \n like this:

// cout << "Hello Neo..." << endl;

// cout << "Hello Neo...\n"



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