I'm used of writing like this:
But here it shows a diffrent way:Code:int server() {}
i'm trying too understand it, but could someone explain?Code:Server::Server() {}
Printable View
I'm used of writing like this:
But here it shows a diffrent way:Code:int server() {}
i'm trying too understand it, but could someone explain?Code:Server::Server() {}
This is when you get into header files and classes/structs. Basically what Server::Server means is that there is a constructor named Server inside either a class or struct named Server.
The first one implements the method inside the body of the class.
The second one implements it outside the class, possibly in another file.
The first might also be a free function that has nothing to do with a class, which is probably what you're used to. If you haven't learned classes yet then that's why you haven't seen the second one.