Is there a way to ensure that all un-initialized pointers automatically have the address 0x00000000? Sometimes they're being set to other addresses but still being unitialized, and they pass tests like if(!ptr), causing an unhandled access violation error.
tomtetlaw -1 Posting Pro
Recommended Answers
Jump to Post>Sometimes they're being set to other addresses but still being unitialized, and
>they pass tests like if(!ptr), causing an unhandled access violation error.
That's the whole point, genius. If you're trying to use an uninitialized pointer, that's a Bad Thing™, and it should be immediately fatal as it's a programming …
Jump to Post>I can't set m->verts[m->numverts] to NULL because at the point before
>if (!m->verts[m->numverts]) , m->verts[m->numverts] doesn't exist
You do realize how ridiculous this sounds, right? "I can't set the object to null because the object doesn't exist when I test it for null". If your code is as whack as …
All 6 Replies
gerard4143 371 Nearly a Posting Maven
tomtetlaw -1 Posting Pro
Narue 5,707 Bad Cop Team Colleague
tomtetlaw -1 Posting Pro
Narue 5,707 Bad Cop Team Colleague
tomtetlaw -1 Posting Pro
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.