I'm just curious whats the difference of ::
and ->
in C++?
Currently studying C++ because I want to study openGL and lots of tutorial in openGL using c++ so I'll just go with language that has many tutorials :)
In java
or C#
if you want to call a function or a reserved function you just use "." like for example text1.getText()
; If you are to convert it to C++
would that be text1->getText()
? and what to call them? Title is not appropriate. If ->
is equal to "." in java
then whats the use of "::"? I believe there are many questions out there like mine but I don't know what to call them so I cant have an accurate information. By the way I found this ::
think while using sfml.
Here is an example
if (event.type == sf::Event::Closed)
{
// end the program
running = false;
}
else if (event.type == sf::Event::Resized)
{
// adjust the viewport when the window is resized
glViewport(0, 0, event.size.width, event.size.height);
}
void renderingThread(sf::Window* window)
{
// activate the window's context
window->setActive(true);
// the rendering loop
while (window->isOpen())
{
// draw...
// end the current frame -- this is a rendering function
(it requires the context to be active)
window->display();
}
}
window uses -> while sf uses ::