Original Post
🔒 Locked
pointing pointers
Advertisement
Quote:
Original post by guyaton
I started it in a new program and it works fine....weird. i wonder y in my program it doesn't work.
You're certain you're not setting it to NULL or redeclaring it elsewhere by acccident? :\ Otherwise, that shouldn't be possible, unless it's in an uncalled function.
Quote:
Original post by guyaton
I am trying to use a pointer to point to a pointer.
So you're almost a ThreeStarProgrammer.
you could use std::vector to make things simpler.
std::vector<int*> someI(1);someI[0] = new int;//or evenstd::vector<int> someI(1);
1.) How are you checking that it is in fact NULL?
2.) Are you sure you aren't actually looking at the dereferenced value, which may or may not cause the program to explode?
3.) If you only need one, why are you using an array?
"Simplified versions" of code snippets frequenty simplify out the issue.... Are you sure there's not something else happening in there?
2.) Are you sure you aren't actually looking at the dereferenced value, which may or may not cause the program to explode?
3.) If you only need one, why are you using an array?
"Simplified versions" of code snippets frequenty simplify out the issue.... Are you sure there's not something else happening in there?
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement