what is ISO C++ forbids comparison between pointer and integer?
godlike111 -5 Newbie Poster
Recommended Answers
Jump to Post>but godlike111 asked why?
Actually, the OP asked "what". ;) But the "why" is because that's a specific constraint in the standard. The fundamental "why" is because pointers are maps to a location, not the location itself. Optimization concerns aside, there's no reason why a pointer couldn't be represented by …
Jump to Post> what is ISO C++ forbids comparison between pointer and integer?
Or ISO C++ forbids comparison between elephant and battle ship.The fact that both are large, grey and heavy doesn't mean that they are in any way the same thing.
In the same way that pointers and …
Jump to Post>The char and int values are different things too but we can
>compare these values in C++ w/o any casting. Moreover,
>we can compare bool and int (bool is not a number!).
That's largely inaccurate. bool, char, and int are all part of the family of integer types. While the …
All 9 Replies
Nick Evan 4,005 Industrious Poster Team Colleague Featured Poster
ArkM 1,090 Postaholic
grumpier 149 Posting Whiz in Training
ArkM 1,090 Postaholic
Narue 5,707 Bad Cop Team Colleague
Salem 5,265 Posting Sage
grumpier 149 Posting Whiz in Training
ArkM 1,090 Postaholic
Narue 5,707 Bad Cop Team Colleague
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.