c++ documentation
c++ documentation
guys i just started the chillie sex guide to game development
but im really confused about the functions and stuff.
is there any place where i could find the docuemntation for the functions and things?
r the functions similar to standard c++ or they like a version of c++ my microsoft?
but im really confused about the functions and stuff.
is there any place where i could find the docuemntation for the functions and things?
r the functions similar to standard c++ or they like a version of c++ my microsoft?
- SlevinKelevra
- Posts: 80
- Joined: September 9th, 2013, 12:58 am
- Location: Germany
Re: c++ documentation
Welcome Kai!
http://www.cplusplus.com/reference/
and
http://en.cppreference.com/w/
For any questions regarding coding (besides this forum ):
https://stackoverflow.com/
Edit:
Ups! I slightly misunderstood your question. But Albinopapa gave the correct answer. For everything else you can use my links from above
http://www.cplusplus.com/reference/
and
http://en.cppreference.com/w/
For any questions regarding coding (besides this forum ):
https://stackoverflow.com/
Edit:
Ups! I slightly misunderstood your question. But Albinopapa gave the correct answer. For everything else you can use my links from above
Last edited by SlevinKelevra on October 27th, 2017, 4:04 pm, edited 1 time in total.
Carpe noctem
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: c++ documentation
Functions are pretty straight forward:
You have a return type which can be any type including void, which means no return.
You have the scope which a free function or global function doesn't need the ::
You have the name of the function followed by the parameter list
For member functions you have a choice to make the function constant, meaning during that function call, you are promising you won't change any of the data members of that object the function belongs to.
Code: Select all
return_type Scope::Name( parameter_list ) const_qualifier;
Examples:
// Global function
void DoSomething();
// Scoped function in namespace
namespace MySpace
{
int AddStuff( int A, int B );
}
// Member function in a class or struct
class MyClass
{
public:
bool IsAlive()const;
private:
bool alive = false;
};
Those are the signatures, now for the definitions
// Global
void DoSomething()
{
// Do work here
}
// Scoped
int MySpace::AddStuff( int A, int B )
{
return A + B;
}
// Member function
bool MyClass::IsAlive()const
{
return alive;
}
// To call each function
// Global
DoSomething();
// Scoped
const int c = MySpace::AddStuff( 3, 39 );
// Member function
MyClass unit;
if(unit.IsAlive())
{
// Handle alive unit
}
else
{
// Handle dead unit
}
You have the scope which a free function or global function doesn't need the ::
You have the name of the function followed by the parameter list
For member functions you have a choice to make the function constant, meaning during that function call, you are promising you won't change any of the data members of that object the function belongs to.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: c++ documentation
Later you will find that there are static functions, virtual functions and templated functions, all pretty much have the same signature requirements and calling syntax with a few exceptions. The only things I know of that are Microsoft specific is the _vectorcall calling convention and being able to write "abstract" instead of "= 0" for virtual functions.
The _vectorcall calling convention uses CPU registers to pass parameters instead of the stack which makes function calls faster. The abstract thing is just syntactic, it means the same as = 0 ( making the function pure virtual meaning the definition to the function is defined by an inherited class ).
The _vectorcall calling convention uses CPU registers to pass parameters instead of the stack which makes function calls faster. The abstract thing is just syntactic, it means the same as = 0 ( making the function pure virtual meaning the definition to the function is defined by an inherited class ).
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
Re: c++ documentation
_____________________________________SlevinKelevra wrote:Welcome Kai!
http://www.cplusplus.com/reference/
and
http://en.cppreference.com/w/
For any questions regarding coding (besides this forum ):
https://stackoverflow.com/
Edit:
Ups! I slightly misunderstood your question. But Albinopapa gave the correct answer. For everything else you can use my links from above
thanks for the answer much appreciated but the functions that chillie is using like gfx.putpixel(); and wnd.kbd.KeyIsPressed(VK_UP)
i cant find them on these sites.
i know that keyIsPressed is a object within object type function but i search these on the net and its like they dont even exist like those functions r custom
Re: c++ documentation
Those functions are user-defined (chilli wrote them). If you want to understand the code you can look over it and (I believe) chili goes over the framework in a couple of the videos.
Computer too slow? Consider running a VM on your toaster.
Re: c++ documentation
Those are a small part of the experience (as small as possible) so don't worry about them too much. Still if you are interested/when you need them:kai wrote:_____________________________________SlevinKelevra wrote:Welcome Kai!
http://www.cplusplus.com/reference/
and
http://en.cppreference.com/w/
For any questions regarding coding (besides this forum ):
https://stackoverflow.com/
Edit:
Ups! I slightly misunderstood your question. But Albinopapa gave the correct answer. For everything else you can use my links from above
thanks for the answer much appreciated but the functions that chillie is using like gfx.putpixel(); and wnd.kbd.KeyIsPressed(VK_UP)
i cant find them on these sites.
i know that keyIsPressed is a object within object type function but i search these on the net and its like they dont even exist like those functions r custom
http://wiki.planetchili.net <- search for "framework" or "keyboard" etc.
Chili
Re: c++ documentation
_______________________chili wrote:Those are a small part of the experience (as small as possible) so don't worry about them too much. Still if you are interested/when you need them:kai wrote:_____________________________________SlevinKelevra wrote:Welcome Kai!
http://www.cplusplus.com/reference/
and
http://en.cppreference.com/w/
For any questions regarding coding (besides this forum ):
https://stackoverflow.com/
Edit:
Ups! I slightly misunderstood your question. But Albinopapa gave the correct answer. For everything else you can use my links from above
thanks for the answer much appreciated but the functions that chillie is using like gfx.putpixel(); and wnd.kbd.KeyIsPressed(VK_UP)
i cant find them on these sites.
i know that keyIsPressed is a object within object type function but i search these on the net and its like they dont even exist like those functions r custom
http://wiki.planetchili.net <- search for "framework" or "keyboard" etc.
aawwww thanks fam for such an awesome series