I’m using Objective-C language. But I don’t know how to use c with Objective-C.
Ex) This is Function method.
- ( ?? ) function{
unsigned int first = ..
unsigned int second = ..
unsigned int third = ..
int infoData = {first,second,third};
return infoData;
}
How to fill in parenthesis.
I don’t use NSArray.
Please help me.
Assuming you declared
int[] infoDatayou could make the returnint*, but you’re still going to have problems because the array is allocated on the function’s stack. You’ll need to dynamically allocate space for it just like you would in C.(You cannot use
int[]as a return type)The code below will compile, but gcc will warn about returning the address of a function local variable.