Command line in Xcode

Hi, I'm new to programming and learning to write code in C for my degree. I'm comfortable with the code side of things, however struggling to get my head around the layout of Xcode and creating projects etc.

Is it possible to create a project with multiple 'programmes' within it? For example I create a project for 'Monday's lecture' that I have several separate source codes in it that are independent of each other to cover each aspect of the lecture?

Also how do I get my programme to compile and run in terminal rather than the window at the bottom of Xcode's? Thanks

Is it possible to create a project with multiple 'programmes' within it? 

AFAIK, not directly. But you can create an app, where the first window will let you select which 'programme' to run, in its won window?

get my programme to compile and run in terminal rather than the window at the bottom of Xcode

Program does not run at the bottom. What you see there are console messages. The app runs independently and sends information to Xcode (when launched from Xcode).

Run in Terminal:

this should help you:

h t t p s : / / mahmudahsan.medium. com/running-and-compiling-swift-code-in-terminal-237ee4087a9c

Is it possible to create a project with multiple 'programmes' within it?

I think the droid you’re looking for here is targets. An Xcode project can have multiple targets. Each of these targets is (by default) built independently. If you’re goal is to have a single Xcode project with multiple command-line tool programs, that’s perfectly feasible:

  1. Start by creating a project from the macOS > Command Line Tool project template.

  2. Within the project, create a new target (File > New > Target) from the macOS > Command Line Tool target template.

You can then switch between programs using Product > Scheme > target.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Command line in Xcode
 
 
Q