class pointers

Discussion in 'C++' started by john townsley, Dec 24, 2004.

  1. hello

    I am a little rustry with C++, when you declare a class method with a
    pointer

    eg...unsigned char *CTexture::LoadBitmapFile(char *fi....

    what does this mean again, is this method of a class pointer?which is?

    thanks
    john townsley, Dec 24, 2004
    #1
    1. Advertising

  2. john townsley

    Jack Klein Guest

    On Fri, 24 Dec 2004 16:40:15 +1100, "john townsley"
    <> wrote in comp.lang.c++:

    > hello
    >
    > I am a little rustry with C++, when you declare a class method with a
    > pointer
    >
    > eg...unsigned char *CTexture::LoadBitmapFile(char *fi....
    >
    > what does this mean again, is this method of a class pointer?which is?
    >
    > thanks


    That means that the function returns a pointer to an unsigned char.
    Most likely, if the member function 'LoadBitmapFile' is any
    indication, it actually points to the first of a number of unsigned
    chars holding the data loaded from the file.

    --
    Jack Klein
    Home: http://JK-Technology.Com
    FAQs for
    comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
    comp.lang.c++ http://www.parashift.com/c -faq-lite/
    alt.comp.lang.learn.c-c++
    http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html
    Jack Klein, Dec 24, 2004
    #2
    1. Advertising

  3. Why is their a need to return a pointer to char why not just a char.
    Why would you return a pointer from a method......would it be to point to a
    large bit of information?

    "Jack Klein" <> wrote in message
    news:...
    > On Fri, 24 Dec 2004 16:40:15 +1100, "john townsley"
    > <> wrote in comp.lang.c++:
    >
    >> hello
    >>
    >> I am a little rustry with C++, when you declare a class method with a
    >> pointer
    >>
    >> eg...unsigned char *CTexture::LoadBitmapFile(char *fi....
    >>
    >> what does this mean again, is this method of a class pointer?which is?
    >>
    >> thanks

    >
    > That means that the function returns a pointer to an unsigned char.
    > Most likely, if the member function 'LoadBitmapFile' is any
    > indication, it actually points to the first of a number of unsigned
    > chars holding the data loaded from the file.
    >
    > --
    > Jack Klein
    > Home: http://JK-Technology.Com
    > FAQs for
    > comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
    > comp.lang.c++ http://www.parashift.com/c -faq-lite/
    > alt.comp.lang.learn.c-c++
    > http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html
    john townsley, Dec 24, 2004
    #3
  4. john townsley

    Jack Klein Guest

    On Fri, 24 Dec 2004 17:30:55 +1100, "john townsley"
    <> wrote in comp.lang.c++:

    Please don't top-post, it is considered rude here and in most
    technical discussion groups. New material you add belongs after the
    quoted material you are replying to, as I did in your original post.
    Do a search on Google, there are patches available for Microsoft's
    brain-dead software to reply properly.

    I have reformatted your post properly, and added a reply at the end
    where it belongs.

    > "Jack Klein" <> wrote in message
    > news:...
    > > On Fri, 24 Dec 2004 16:40:15 +1100, "john townsley"
    > > <> wrote in comp.lang.c++:
    > >
    > >> hello
    > >>
    > >> I am a little rustry with C++, when you declare a class method with a
    > >> pointer
    > >>
    > >> eg...unsigned char *CTexture::LoadBitmapFile(char *fi....
    > >>
    > >> what does this mean again, is this method of a class pointer?which is?
    > >>
    > >> thanks

    > >
    > > That means that the function returns a pointer to an unsigned char.
    > > Most likely, if the member function 'LoadBitmapFile' is any
    > > indication, it actually points to the first of a number of unsigned
    > > chars holding the data loaded from the file.

    >
    > Why is their a need to return a pointer to char why not just a char.
    > Why would you return a pointer from a method......would it be to point to a
    > large bit of information?


    Read my reply again. This time read all the words, and think about
    the last sentence that I wrote. If you still don't understand why a
    function like this would return a pointer, you are more than rusty and
    I would suggest getting a good book on C++.

    --
    Jack Klein
    Home: http://JK-Technology.Com
    FAQs for
    comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
    comp.lang.c++ http://www.parashift.com/c -faq-lite/
    alt.comp.lang.learn.c-c++
    http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html
    Jack Klein, Dec 24, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. E11
    Replies:
    1
    Views:
    4,736
    Thomas Weidenfeller
    Oct 12, 2005
  2. Phil
    Replies:
    1
    Views:
    643
    llewelly
    Sep 16, 2003
  3. muser
    Replies:
    3
    Views:
    759
    Ron Natalie
    Sep 18, 2003
  4. A
    Replies:
    3
    Views:
    453
    Alan Kelon
    Oct 29, 2003
  5. cerr

    pointers, pointers, pointers...

    cerr, Apr 7, 2011, in forum: C Programming
    Replies:
    12
    Views:
    668
Loading...

Share This Page