Testing a pure C code on Xcode? -


i trying use latest xcode simulate c code, has nothing iphone, test data manipulation on c functions, , print results see working.

i have started new playground in xcode , ios , gives error when try write c code ( char me[]= "this me" ; )

how can anyway ? thanks.

the playground swift, not c, hence errors.

you can develop c programs using xcode, want target osx, using command line project template.

start writing main():

#include <stdio.h>  int main(int argc, const char **argv) {     printf("hello world!\n");     return 0; } 

edit: in order call function outside of main() must declare before referenced:

// forward declaration of function static void printit(const char *message);  int main(int argc, const char **argv) {     printit("hello world\n");     return 0; }  static void printit(const char *message) {     fwrite(message, 1, strlen(message), stdout); } 

Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -