|
-
Aug 31st, 2002, 03:04 PM
#1
Thread Starter
Frenzied Member
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 .
Magiaus
If I helped give me some points.
-
Aug 31st, 2002, 03:30 PM
#2
Ya ya Baby!!!Me is Back
-> = *. 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();
-
Aug 31st, 2002, 03:32 PM
#3
Thread Starter
Frenzied Member
Magiaus
If I helped give me some points.
-
Aug 31st, 2002, 04:27 PM
#4
Monday Morning Lunatic
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.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 31st, 2002, 04:29 PM
#5
Thread Starter
Frenzied Member
ok
what will that effect?
Magiaus
If I helped give me some points.
-
Aug 31st, 2002, 04:31 PM
#6
Monday Morning Lunatic
The variable at global (file) scope, i.e. the one not within A, B, or code().
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 31st, 2002, 04:32 PM
#7
Thread Starter
Frenzied Member
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
Magiaus
If I helped give me some points.
-
Aug 31st, 2002, 04:34 PM
#8
Thread Starter
Frenzied Member
Magiaus
If I helped give me some points.
-
Aug 31st, 2002, 04:35 PM
#9
Monday Morning Lunatic
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...
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 31st, 2002, 04:38 PM
#10
Thread Starter
Frenzied Member
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
Magiaus
If I helped give me some points.
-
Aug 31st, 2002, 04:38 PM
#11
Thread Starter
Frenzied Member
oh yeah and the mighty sql and the want to be mighty xml
Magiaus
If I helped give me some points.
-
Aug 31st, 2002, 04:41 PM
#12
Monday Morning Lunatic
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.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 31st, 2002, 04:45 PM
#13
Thread Starter
Frenzied Member
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....
Magiaus
If I helped give me some points.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|