-
um i feel dumb but
this is related to my other post well vagely. what do the operators :: and -> do? i have basic knowladge o c++ i can write simple applications but none of books explain that very well. i understand it works as some sort of dot dyntax giving you access to prperties or methods or whatever but what is the diffreance between :: , -> and a regular .
-
-> = *. is needed to go in a pointer that point to an object
and :: is to point function in a class
Code:
class a
{
void b();
}
a::b();
-
-
Daok is right with :: going to members of a class, but it's more general than that. Technically, it's the scope resolution operator. For example:
Code:
namespace A {
int number;
};
namespace B {
int number;
};
int number;
void code() {
int number(278);
A::number = 5;
B::number = 7;
number = 2;
::number = 1;
}
That last one resolves to the global namespace, i.e. what anything is in if it's not within a class, struct, or namespace.
-
ok
what will that effect?
-
The variable at global (file) scope, i.e. the one not within A, B, or code().
-
and
to be more clear on what i know i understand about building classes and using class constructors and all that though i usally go inline with it. i just haven't done that much work in c++ and am trying to get more into it now so that i can expose some of the api and interfaces i want to use to the .net framework
and right now i am looking for information on using mfc macros to implement interfaces so i can answer a question in the vb.net formum about getting the url prpoerty from an internet shortcut file .url
anyway's incase you can't tell i'm real bored right now
-
-
Learn C++ first, not MFC, and not .NET.
If you find you need it, learn .NET in preference to MFC. I prefer raw code anyway, and am making a break away from Windows at the moment, anyway ;)
There's a hell of a lot you can do with the language without needing a GUI, or anything else not provided in the standard library...
-
well i know vb, vb.net (sorta), most of the windows api, javascript, actionscript, php, basic c++ and some other junk
i am not lost or anything i just haven't delved into it this deeply before
-
oh yeah and the mighty sql and the want to be mighty xml
-
XML is overrated. By a looooooong way.
Knowing the windows API won't help you with advanced C++, although it works the other way round.
-
well i can translate the msdn c++ api documentaion to a vb6 decloration but even that doesn't help much when i get into advanced c++. i mean i can write your basic windows app in c++ but a dll or com object is allot for me right now i am reading my asp componets in vb, vc++ and vj right now to get a grip on it and i have my advanced vc++ programming book out
i hate understanding how it works but not the implementation....