Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Thu Mar 28, 2024 9:28 am
All times are UTC + 0
Newbie C++ question
Moderators: Global Moderators
Post new topic   Reply to topic Page 1 of 1 [5 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
MadHQ
Commander


Joined: 07 Nov 2003

PostPosted: Fri Jan 11, 2019 6:27 am    Post subject:  Newbie C++ question Reply with quote  Mark this post and the followings unread

I have a newbie C++ question, I have decided to look into C++ a little more and have found myself a little puzzled about something. I don't even know where to start looking.

This code for example.

Code:

#include <gtkmm.h>

int main(int argc, char* argv[]){

    Gtk::Main kit(argc, argv);
    Gtk::Window window;
    Gtk::Main::run(window);
    return 0;

}


What is the deal with the 'Gtk' and '::'?

I guess Gtk is the object? but I do see what looks like the object is 'window'. I am not wondering about Gtk stands for, or what library it comes from, but why is it there?

And I have no idea what the '::' even does.

What should I be googling for to find out what that syntax is.

_________________
MadHQ's Graveyard - Click here!
(Permissions) - (F.A.Q.)

Back to top
View user's profile Send private message Skype Account
Banshee
Supreme Banshee


Also Known As: banshee_revora (Steam)
Joined: 15 Aug 2002
Location: Brazil

PostPosted: Fri Jan 11, 2019 10:45 am    Post subject: Reply with quote  Mark this post and the followings unread


Back to top
View user's profile Send private message Visit poster's website Skype Account
cxtian39
Commander


Joined: 11 Feb 2016

PostPosted: Fri Jan 11, 2019 7:23 pm    Post subject: Reply with quote  Mark this post and the followings unread

:: is to access stuff inside namespace & class

_________________

Back to top
View user's profile Send private message Skype Account
G-E
Defense Minister


Joined: 09 Feb 2015

PostPosted: Fri Jan 11, 2019 10:10 pm    Post subject: Reply with quote  Mark this post and the followings unread

Yea you can have nested namespaces to keep the variable names  or functions of the same without interfering. Anything complex that is likely to overlap should probably have its own.

_________________
http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-ai

Back to top
View user's profile Send private message
MadHQ
Commander


Joined: 07 Nov 2003

PostPosted: Fri Jan 11, 2019 11:30 pm    Post subject: Reply with quote  Mark this post and the followings unread

Interesting, that is very helpful!

C++ has some very different ways to go about things... It kind of seems like I kind of like C#/Java a little better...

Thanks!

_________________
MadHQ's Graveyard - Click here!
(Permissions) - (F.A.Q.)

Back to top
View user's profile Send private message Skype Account
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [5 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
Quick Reply
Username:


If you are visually impaired or cannot otherwise answer the challenges below please contact the Administrator for help.


Write only two of the following words separated by a sharp: Brotherhood, unity, peace! 

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

[ Time: 0.1342s ][ Queries: 11 (0.0080s) ][ Debug on ]