944,067 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 6302
  • C++ RSS
Aug 31st, 2007
0

difference between pointers and handles

Expand Post »
hello everyone,

i am a rookie in C++ programming, can someone please clarify my one doubt regarding difference between handles and pointers ?? actually i am little confused about handles, can any one please clarify what exactly is a Handle and why is it used??
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Ashu@sym is offline Offline
18 posts
since Aug 2007
Aug 31st, 2007
0

Re: difference between pointers and handles

A handle is an opaque pointer.
Last edited by Hamrick; Aug 31st, 2007 at 11:07 am.
Reputation Points: 180
Solved Threads: 34
Posting Whiz
Hamrick is offline Offline
322 posts
since Jun 2007
Aug 31st, 2007
0

Re: difference between pointers and handles

AFAIK the C and C++ languages don't define the term 'handle', so its use can vary according to context.

In addition to the usage as described in Hamrick's link, some texts use 'handle' to describe C++ References .. in this context, 'handle' is a synonym for 'alias' or 'nickname'.
Last edited by Bench; Aug 31st, 2007 at 1:02 pm.
Reputation Points: 307
Solved Threads: 62
Posting Pro
Bench is offline Offline
565 posts
since Feb 2006
Aug 31st, 2007
0

Re: difference between pointers and handles

Hamrick's link is about as succenct as you can get. The why on the other hand probably will never be know. It could be deliberate, accidental or just a matter of convienence as code is being developed, modfied or upgraded. Concentrate more on the API's that provide you handles to files, memory, windows etc, and how they are used in other API's.
Reputation Points: 47
Solved Threads: 17
Posting Whiz in Training
Tight_Coder_Ex is offline Offline
215 posts
since Feb 2005
Sep 1st, 2007
0

Re: difference between pointers and handles

Click to Expand / Collapse  Quote originally posted by Hamrick ...
A handle is an opaque pointer.

Thanks a ton Hamrick!! well the concept is somewhat now clear!!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Ashu@sym is offline Offline
18 posts
since Aug 2007
Sep 1st, 2007
0

Re: difference between pointers and handles

Click to Expand / Collapse  Quote originally posted by Ashu@sym ...
hello everyone,

i am a rookie in C++ programming, can someone please clarify my one doubt regarding difference between handles and pointers ?? actually i am little confused about handles, can any one please clarify what exactly is a Handle and why is it used??
The term handle is used to mean any technique that lets you get to another object — a generalized pseudo-pointer. The term is (intentionally) ambiguous and vague.

Read more
SpS
Reputation Points: 70
Solved Threads: 32
Posting Pro
SpS is offline Offline
598 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Good C++ tutorials
Next Thread in C++ Forum Timeline: Is this undefined behaviour?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC