Xcode will not build function

I am self-learning basic C programming and have installed Xcode v. 14.2 on MacOS Monterey v. 12.7.5. I cannot get any programs I write under a new project I created to build and run on Xcode. Here is an example of what I am trying to build and run:

#include <stdio.h>

int main() { char test_string[] = "new string text";

printf("This process will %s\n",test_string);

return(0);

}

Any guidance or feedback would be appreciated.

Answered by DTS Engineer in 812548022

main needs a very specific set of parameters in the function declaration , like this:

int main(int argc, const char * argv[]) {
    // insert code here...
    printf("Hello, World!\n");
    return 0;
}

— Ed Ford,  DTS Engineer

main needs a very specific set of parameters in the function declaration , like this:

int main(int argc, const char * argv[]) {
    // insert code here...
    printf("Hello, World!\n");
    return 0;
}

— Ed Ford,  DTS Engineer

The tutorial I'm using on LinkedIn is running this program and others without any arguments in the main function. I think I may have Xcode setup issue. Thanks for responding.

Xcode will not build function
 
 
Q