473,394 Members | 1,567 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

class pointers

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
Jul 22 '05 #1
3 1601
On Fri, 24 Dec 2004 16:40:15 +1100, "john townsley"
<jo**********@optusnet.com.au> 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
Jul 22 '05 #2
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" <ja*******@spamcop.net> wrote in message
news:8s********************************@4ax.com...
On Fri, 24 Dec 2004 16:40:15 +1100, "john townsley"
<jo**********@optusnet.com.au> 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

Jul 22 '05 #3
On Fri, 24 Dec 2004 17:30:55 +1100, "john townsley"
<jo**********@optusnet.com.au> 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" <ja*******@spamcop.net> wrote in message
news:8s********************************@4ax.com...
On Fri, 24 Dec 2004 16:40:15 +1100, "john townsley"
<jo**********@optusnet.com.au> 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
Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jon | last post by:
Hello all, I'm certain this question has been asked before; I was unsure what terms to search for within the newsgroup archive to find the proper answer I wanted. Hopefully someone can point me...
4
by: Oystein Haare | last post by:
Is it best to declare class member objects as pointers or not pointers? class A { public: A(int i); //.... };
10
by: Bhan | last post by:
Using Ptr of derived class to point to base class and viceversa class base { .... } class derived : public base { .... }
5
by: FefeOxy | last post by:
Hi, > I'm having a debug assertion error within the file dbgdel.cpp with the expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse) I traced the origin of the error and it happened as I tried to...
3
by: Bilgehan.Balban | last post by:
Hi, How do I declare an array of function pointers and assign each element of the array with public member functions of a class? Is it possible that the array is not a member of the class? ...
20
by: Joe Van Dyk | last post by:
Is there some rule of thumb about when to use pointers to an object and when to use a reference* to an object when a class needs to have objects as data members? Example: class A { B* b_ptr;...
5
by: Gert Van den Eynde | last post by:
Hi all, It's probably trivial but I can't figure it out... I have a templated class template <typename T, typename uclass A I wish to fill a vector with pointers to objects of class A. I...
1
by: Bushido Hacks | last post by:
A private utility function using a function pointer sounds ideal to me. I want to simpify writing the same set of loops. While there are a few functions that can't use it, setting and modifying...
15
by: Juha Nieminen | last post by:
I'm sure this is not a new idea, but I have never heard about it before. I'm wondering if this could work: Assume that you have a common base class and a bunch of classes derived from it, and...
16
by: John Doe | last post by:
Hi, I wrote a small class to enumerate available networks on a smartphone : class CNetwork { public: CNetwork() {}; CNetwork(CString& netName, GUID netguid): _netname(netName),...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.