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??

Recommended Answers

All 5 Replies

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'.

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.

A handle is an opaque pointer.

Thanks a ton Hamrick!! well the concept is somewhat now clear!!

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.