C code in Bmax

BlitzMax Forums/BlitzMax Programming/C code in Bmax

Najdorf(Posted 2005) [#1]
can you use some C code for critical functions in blitzmax? If so, is there some example available somewhere?

Thx,

Matteo


Perturbatio(Posted 2005) [#2]
C file:
/* addnum.c */
int addFive( int x ){
	return x+5;
}


BMax file:
Import "addnum.c"

Extern
	Function addFive( x )
End Extern

a = 10
a = addFive(a)
print a




N(Posted 2005) [#3]
That'd be a = addFive(a), Pert ;)


Pedro(Posted 2005) [#4]
have a look on : http://www.blitzwiki.org/index.php/C_CallBacks


Perturbatio(Posted 2005) [#5]
That'd be a = addFive(a), Pert ;)


Uh, yeah. Well spotted. top marks to you.


Najdorf(Posted 2005) [#6]
thanks :)