While the title is probably confusing, I want to be able to check if an address that I'm dereferencing is a valid pointer or not. I don't mean whether or not it fits the bill of nullptr or not, but whether or not its a pointer or another type of data. The current function I have for this is
for (int player = 0;player < 31;player += 1) { // iterate each player offset, which is every 4 offsets
if ((entList->bot[player] == nullptr || NULL) || (entList->bot[player]->health == NULL)) return; // checks to see if whats being accessed is null, and returns if it doesnt
entList->bot[player]->health = 1; // trying to directly modify hp of every iteration
}
This issue is that it wants to dereference ints, which obviously can't be done. This is the int I mean.
realized the image wasn't very helpful without context, the screenshot is of the entList array in Cheat Engine (on the right) and the value of what entList->[player]
gives in Visual Studio (on the left).
So to summarize my question, how would I skip over data in a for loop that isn't of the data type I'm looking for?