Is const void* p the same as a null pointer? Why would i use it?
bumsfeld
413
Nearly a Posting Virtuoso
Recommended Answers
Jump to PostIs const void* p the same as a null pointer? Why would i use it?
No, that's a pointer named p. You might use it for holding the memory address of something. For example, memcpy takes a const void* argument.
Jump to PostA NULL pointer is a pointer that points to address 0
const void *p = 0;
Jump to Post>A NULL pointer is a pointer that points to address 0
Bad dragon, now you're just confusing people. A null pointer doesn't have to refer to a specific address, and just because 0 is a null pointer constant doesn't mean it points to address 0.
Jump to Postjust because 0 is a null pointer constant doesn't mean it points to address 0.
You are splitting hairs -- the memory location of a pointer contains an address. A NULL pointer ALWAYS has absolute address 0 in C and C++ programs. Its up to the implementation to evaluate that …
All 15 Replies
Rashakil Fol
978
Super Senior Demiposter
Team Colleague
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
bumsfeld
413
Nearly a Posting Virtuoso
Narue
5,707
Bad Cop
Team Colleague
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
SpS
34
Posting Pro
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
SpS
34
Posting Pro
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Narue
5,707
Bad Cop
Team Colleague
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Narue
5,707
Bad Cop
Team Colleague
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Narue
5,707
Bad Cop
Team Colleague
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
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.