[Request] Help with cpp files

support for the ARM toolchain
Post Reply
opearn
Posts: 23
Joined: Tue Feb 17, 2009 11:29 am

[Request] Help with cpp files

Post by opearn » Sun Feb 22, 2009 9:44 am

hi every one,
i would like some info on using one cpp file containing code and using it with my main.cpp

e.g

if i have a file called helloworld.cpp in my src directory

and it contains code eg

Code: Select all

iprintf("      Hello World\n");
how do i call this code in my main.cpp file?

e.g

Code: Select all

/*---------------------------------------------------------------------------------

	$Id: main.cpp,v 1.13 2008/12/02 20:21:20 dovoto Exp $

	Simple console print demo
	-- dovoto


---------------------------------------------------------------------------------*/
#include <nds.h>
//#include <helloworld_cpp.h>?
int main(void) {
	while(1) {
       // (helloworld.cpp... unknown code here)?
	}
	return 0;
}
i would like to know how to do this because i'm making a first person shooter and would like to contain most of the code i seperate files, to maintain cleanliness.
i would also need to be able to use variables in the code snipet that are read by main.cpp after the code snippet has executed...

opearn
Posts: 23
Joined: Tue Feb 17, 2009 11:29 am

Re: [Request] Help with cpp files

Post by opearn » Sun Feb 22, 2009 10:16 am


Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests