Yup, C/C++ gives you all the rope you could ever want, the rest is up
to you. :-)

Curt.


David Luff writes:
> That's how they are in soundmgr.hxx (they're two different functions - one
> is passing in an FGSimpleSound pointer to the sound manager and the other
> the file name.)
> 
> I've found the proper answer to my problem now - I was doing:
> 
> FGSimpleSound simple("temp01.wav");
> globals->get_soundmgr()->add(&simple, refname);
> 
> which doesn't work, whereas the following does work:
> 
> FGSimpleSound* simple = new FGSimpleSound("temp01.wav");
> globals->get_soundmgr()->add(simple, refname);
> 
> In my initial case, when simple went out of scope when my function
> returned, this must have been leaving the sound manager with no
> FGSimpleSound, and causing the fatal error.  Thus no compile time error,
> but it wouldn't work.
> 
> I guess I need to chant "A POINTER IS NOT THE SAME AS A REFERENCE" or
> possibly "THE STACK IS NOT THE SAME AS THE HEAP" a couple of thousand
> times!
> 
> Given that I also got bitten by the
> 
> char* str = "Hello";
> 
> is not the same as
> 
> char str[] = "Hello";
> 
> business a few days ago, I feel like I've been slapped repeatedly around
> the head with a giant cod with C/C++ written on it!!
> 
> Cheers - Dave
> 
> 
> 
> 
> _______________________________________________
> Flightgear-devel mailing list
> [EMAIL PROTECTED]
> http://mail.flightgear.org/mailman/listinfo/flightgear-devel

-- 
Curtis Olson   IVLab / HumanFIRST Program       FlightGear Project
Twin Cities    [EMAIL PROTECTED]                  [EMAIL PROTECTED]
Minnesota      http://www.menet.umn.edu/~curt   http://www.flightgear.org

_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to