Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does swift support C natively?

Tags:

ios

swift

Objective C can compile C natively. Objective C was built over C. Can swift do the same? If not what are the differences.

like image 400
Dipesh Somvanshi Avatar asked Jul 09 '26 03:07

Dipesh Somvanshi


1 Answers

Unlike Objective-C, which is a proper superset of C, Swift has been built as an entirely new language. Swift cannot compile C code because the syntax is not compatible.

Swift can interoperate wit C code (see Interacting with C APIs article for more information). However, C code behind the APIs needs to be compiled separately, using a C compiler.

like image 156
Sergey Kalinichenko Avatar answered Jul 11 '26 21:07

Sergey Kalinichenko



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!