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 a discussion on Whats this? ( newbie question ) within the C++ Programming forums, part of the General Programming Boards category; I'm used of writing like this: Code: int server() {} But here it shows a diffrent way: Code: Server::Server() {} ...
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.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
I support http://www.ukip.org/ as the first necessary step to a free Europe.
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.