Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / help making and using functions in C++

Author
Message
ThatOther Person
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location:
Posted: 21st Apr 2009 09:16
I'm having a bit of trouble using functions. I've tried following what I can find online but none of the changes I try seem to work. Anyways here is sort of the relevant bits of code that will at least explain what it is that I'm trying to do.



I think it should be fairly clear what the intended result is I just don't know how to properly write it.
DarthVader 335
17
Years of Service
User Offline
Joined: 18th May 2007
Location: Cyberspace
Posted: 21st Apr 2009 13:19
You have the right idea your just missing one piece.

Your MakeTrack function should look like this


You had most of it right you were just missing the return type you could have used anything e.g float,int, or void. So all your functions should look something like this



or


If your going to write a function like the one above though your call will look different instead of just
Calc();
you'll have to have a variable to store the value coming back in e.g
Num = Calc();

The only limit to creating video games is your imagination
ThatOther Person
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location:
Posted: 21st Apr 2009 15:09
I finally got it working
thanks

Login to post a reply

Server time is: 2024-09-30 23:32:55
Your offset time is: 2024-09-30 23:32:55