Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to assign a value to a pointer in Carbon



On 11/27/03 12:24 PM, ai cui didst favor us with:

> my code doesn't work well in Xcode:
>
> int *p1;
> int *p2;
> *p=200; // EXC_BAD_ACCESS occur when debuging
>
>
> So, is there a real POINTER data type in Carbon?

Of course there's a pointer data type in Carbon. Did you consider what it's
pointing to?

> Why is it so weird when use it?

Because you're writing sizeof(int) bytes out to a random location in memory.
You have to allocate storage to which the pointer points. This isn't an
XCode issue, it's a programming issue.

Larry
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.

References: 
 >How to assign a value to a pointer in Carbon (From: ai cui <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.