Objective-C中的C數組和代碼

[英]C Arrays and code in Objective-C


Can someone please share an example of C/Objective-C code where we:

有人可以分享一下C / Objective-C代碼的例子,其中我們:

  • declare a c structure with some int properties (a, b, c)
  • 聲明一個帶有一些int屬性的c結構(a,b,c)
  • create (in objective-c) a C array that contains items from the previously mentioned structure
  • 創建(在objective-c中)包含前面提到的結構中的項的C數組
  • call (in objective-c) a c method that takes the created array as an argument
  • 調用(在objective-c中)一個c方法,它將創建的數組作為參數

(Optionally)

(任選地)

  • call (in objective-c) an objective-c method that takes the created array as an argument
  • 調用(在objective-c中)一個objective-c方法,它將創建的數組作為參數
  • call (in c) an objective-c method that takes the created array as an argument
  • 調用(在c中)一個objective-c方法,它將創建的數組作為參數

1 个解决方案

#1


2  

Objective C is a pure superset of ANSI C. So the variable types and struct declarations would be identical with those in C, as you can find in any book on C.

Objective C是ANSI C的純超集。所以變量類型和結構聲明與C中的相同,正如你在C上的任何一本書中都能找到的那樣。


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2011/02/06/72f0ee7288ed62f406d5a9042327cb46.html



 
粤ICP备14056181号  © 2014-2021 ITdaan.com