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












// Our new header file called myheader.h

#ifndef _MYHEADER_H // if not defined
#define _MYHEADER_H // define MyHeader


#include <stdio.h> // include our extern files
#include <iostream>	
using namespace std;


// declare function 3 with an argumen 
// in our header file, this function returns an integer
int  myFunc_3(int number);	



#endif // end if not defined, and end the header file



// Our new source file

#include "myheader.h" // include our header file 

int myFunc_3(int number) // define function 3 
{

	return  number + 2;
}



// include our new header file 
// (we use "" because the file is in our program folder.)
#include "myheader.h" // include our header file	

int main()
{	
	cout << myFunc_3(5); // display the returned value of function 3

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

	return 0; // return zero
}


/*
Learn to use a multiple header and source files in c/c++.
This program is almost the same program as in the Header File Tutorial.
It uses function 3, and one extra source file.


The header file can be used to gain global access to your functions.
This means that your functions can be called from different source files
as long as the header file is included.
Use this to methods to obtain more structured programming as 
your programs grow larger.
*/



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