Skip to content

Instantly share code, notes, and snippets.

@Phuseos
Last active April 18, 2017 09:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Phuseos/83d382f3c906b1b5f9552f7e7cf8dacc to your computer and use it in GitHub Desktop.
Save Phuseos/83d382f3c906b1b5f9552f7e7cf8dacc to your computer and use it in GitHub Desktop.
Prints a predifined string to the terminal, for usage with macOS
#import <stdio.h>
#define INTNUMBER 10
#define NEWLINE '\n'
int main(){
//Simple program that prints 'Defined number found: 10' when ran.
printf("Defined number found: %d", INTNUMBER);
printf("%c", NEWLINE); //Creates a new line
return 0;
}
/*
USAGE
Compile on a mac terminal: cc YourFileHere.c -o YourProgramNameHere
You can run it by entering in the terminal: ./YourProgramNameHere
Replace YourFileHere with your .c file and YourProgramNameHere with the name you want to give your program.
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment