Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > class pointers

Reply
Thread Tools

class pointers

 
 
john townsley
Guest
Posts: n/a
 
      12-24-2004
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


 
Reply With Quote
 
 
 
 
Jack Klein
Guest
Posts: n/a
 
      12-24-2004
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/~a...FAQ-acllc.html
 
Reply With Quote
 
 
 
 
john townsley
Guest
Posts: n/a
 
      12-24-2004
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/~a...FAQ-acllc.html



 
Reply With Quote
 
Jack Klein
Guest
Posts: n/a
 
      12-24-2004
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/~a...FAQ-acllc.html
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
pointers, pointers, pointers... cerr C Programming 12 04-07-2011 11:17 PM
Nested Class, Member Class, Inner Class, Local Class, Anonymous Class E11 Java 1 10-12-2005 03:34 PM
c++: pointers to pointers A C++ 3 10-29-2003 01:15 PM
pointers to pointers // exception handling error muser C++ 3 09-18-2003 06:19 PM
Template specialization of pointers with function pointers Phil C++ 1 09-16-2003 02:17 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57