-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|513|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Blogs Home -> Blogs


 
spinal
Created : 05 November 2015
 
System : Mac

Global Variables!



And this is why I hate c++ with all my being!

main.h
extern bool checkSound;


c64_nds.i
#include "main.h"
bool soundCheck=false;


sid_3ds.i
#include "main.h"
bool soundCheck=false;


multiple definition of 'soundCheck'

Why the hell can C based languages do global variable in some sort of sensible way?

 

Comments


Thursday, 05 November 2015, 05:38
Jayenkai
PHPs a bitch for Globals. You need to respecify that it's a global in EVERY SINGLE FUNCTION!!!!

Thank god for Blitz!!
Thursday, 05 November 2015, 06:33
cyangames
You can always store global variables in the $GLOBALS array. So you could write the following:



Hope this helps out with future PHP stuffs