Re: pointer value into floating point value???HELP???
Re: pointer value into floating point value???HELP???
- Subject: Re: pointer value into floating point value???HELP???
- From: Brent Gulanowski <email@hidden>
- Date: Wed, 27 Aug 2003 20:13:31 -0400
On Wednesday, August 27, 2003, at 07:24 PM, Rhon Fitzwater wrote:
static float *ws1R;
static float *ws1G;
static float *ws1B;
Uh, there are two problems: syntax AND method.
You have to dereference the pointers in order to store data values, but
first the pointers have to point somewhere!
So you might want to add:
ws1R = (float *)malloc( sizeof(float)*3 );
ws1G = ws1R+sizeof(float);
ws1B = ws1G+sizeof(float);
and, for example:
*ws1R = [timerValue intValue];
ws1R = [timerValue intValue]; // this converts the string into an
integer// I tried it without this as well
ws1G = [[dictws1 objectForKey: @"G"]retain];
ws1G = [timerValue intValue]; // this converts the string into an
integer// I tried it without this as well
ws1B = [[dictws1 objectForKey: @"B"]retain];
ws1B = [timerValue intValue]; // this converts the string into an
integer// I tried it without this as well
NSColor *col = [NSColor colorWithCalibratedRed:(float)ws1R
green:(float)ws1G blue:(float)ws1B alpha:1.0];
I get this error when I build:
MyProgram.m:111: error: pointer value used where a floating point value
was expected
Is there a way to convery a pointer value to a floating point value.
I may be totally off on my thinking, but I hope you can do what I am
doing above.
Any suggestions on how to fix this?
Thanks,
-rhon
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
--
Brent Gulanowski email@hidden
We've heard that a million monkeys at a million keyboards could produce
the Complete Works of Shakespeare; now, thanks to the Internet, we know
this is not true.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.