Pointer variable storage

Just starting out? Need help? Post your questions and find answers here.
UrgentKettle
User
User
Posts: 12
Joined: Thu Jan 27, 2011 12:25 pm

Pointer variable storage

Post by UrgentKettle »

Hello

Perhaps this is really a question for Fred, but maybe someone else knows: Is the pointer storage a signed or unsigned variable?

I have had some code that worked under Windows however when I ported to Linux I ran into a problem when checking for allocated memory by seeing if the value of *SomePointer was greater than 0. On Windows there was no problem but under Linux I got a negative value. Simply changing the check to Less Than or Greater Than Zero solved the problem, but it got me wondering...

This was with PB 5.00

Cheers
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Pointer variable storage

Post by Fred »

a pointer does not have a sign, you should never test it otherwise than <> 0.
Post Reply