Results 1 to 13 of 13

Thread: um i feel dumb but

  1. #1

    Thread Starter
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    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.

  2. #2
    Ya ya Baby!!!Me is Back
    Join Date
    Jul 2002
    Posts
    362
    -> = *. 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();

  3. #3

    Thread Starter
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267
    ok, cool
    Magiaus

    If I helped give me some points.

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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

  5. #5

    Thread Starter
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267
    ok

    Code:
    ::number = 1
    what will that effect?
    Magiaus

    If I helped give me some points.

  6. #6
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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

  7. #7

    Thread Starter
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    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.

  8. #8

    Thread Starter
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267
    i had not seen that one
    Magiaus

    If I helped give me some points.

  9. #9
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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

  10. #10

    Thread Starter
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267
    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.

  11. #11

    Thread Starter
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267
    oh yeah and the mighty sql and the want to be mighty xml
    Magiaus

    If I helped give me some points.

  12. #12
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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

  13. #13

    Thread Starter
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267
    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
  •  



Click Here to Expand Forum to Full Width