-1
typedef struct
{
short data[];

short sampleData[];

BOOL sample[];

}customMembers;

I declared like this but I am getting error like following

"Filed has incomplete type short[]"

Please help me

Code cracker
  • 3,105
  • 6
  • 37
  • 67
  • @Antzi I understand the difference. But I want to use Java short[] array in Objective-c. What is the equivalent in Objective-c? – iOS_Dev iOS Dec 12 '14 at 09:29

1 Answers1

1

You must provide a length like this short data[42] for your arrays or define it as a pointer short *.

If not, the size of the struct would be unknown.

See C: differences between char pointer and array for more informations about the difference between the two.

Community
  • 1
  • 1
Antzi
  • 12,831
  • 7
  • 48
  • 74