Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > Mac OS X Development Forums > Mac OS X Development

Reply
 
LinkBack Thread Tools Display Modes
Old 07-25-2009, 02:07 PM   #1 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 148
rraagg is on a distinguished road
Default Structure Array Pointer Not working

Hi
I have a Structure
and an Array of the Structure
I am trying to pass the Structure array in as a pointer. But i get build errors?

my Code:

Code:
#define kNoSigns	  12

//Struc
struct StarSign{ 
    char    SignName[10]; 
};

//Vars
struct StarSign gTheStartSignsArray [kNoSigns];


int main (int argc, char * const argv[]) {
    
	PopSturctArray2( &gTheStartSignsArray[kNoSigns]);

    return 0;
}



void PopSturctArray2(struct StarSign *StarsignAdd[kNoSigns])
{
	int intCount = 0;

	for (intCount=0; intCount<12; intCount++) 
	{
		strcpy(StarsignAdd[intCount]->SignName,"Aries");
	}
	
	
	for (intCount=0; intCount<12; intCount++) 
	{
		printf("%s\n",StarsignAdd[intCount]->SignName);
	}
	
}
The strang thing is when I build i get no RED LINE errors, the status bar
just says "Build failed (1 error)". So I cant tell where the error is?Any ideas anyone?
rraagg is offline   Reply With Quote
Old 07-26-2009, 11:11 AM   #2 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 148
rraagg is on a distinguished road
Default

So I take it no one knows :-(
rraagg is offline   Reply With Quote
Old 08-27-2009, 11:51 AM   #3 (permalink)
Registered Member
 
Join Date: Apr 2009
Posts: 27
remover is on a distinguished road
Default

Quote:
Originally Posted by rraagg View Post
So I take it no one knows :-(

Sorry dude, I had a go but couldn't figure it out. See if you can get to the bottom of this one...

I just want to make a pointer to a CGPoint struct. I can do it if i first copy my views frame and then reference its origin. But if i try and copy the address of the origin pointer without first copying the frame that that origin point resides in I get an error: "Ivalue required as unary '&' operand". Any ideas?

CGPoint *ptr;
CGRect rect = aView.frame;

ptr = &rect.origin;// this is allowed
ptr = &aView.frame.origin;// this is not allowed ?!
remover is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 472
14 members and 458 guests
alexeir, David-T, Dj_kades, foslock, iAppDeveloper, jeroenkeij, Mijator, myach, pipposanta, QuantumDoja, robsmy, sacha1996, SLIC, usernametaken
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,679
Threads: 94,129
Posts: 402,928
Top Poster: BrianSlick (7,990)
Welcome to our newest member, xzoonxoom
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:28 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0