Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
/* * Demonstrating common GCC compilation flags. * * Compile (basic): * gcc greet.c -o greet * * Compile (recommended for development): * gcc -Wall -Wextra -std=c11 -g greet.c -o greet * * Preprocess only (see macro expansion): * gcc -E greet.c * * Compile to assembly: * gcc -S greet.c # produces greet.s */ #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { if (argc < 2) { fprintf(stderr, "Usage: %s <name> ", argv[0]); return EXIT_FAILURE; /* EXIT_FAILURE == 1 on most systems */ } printf("Hello, %s! ", argv[1]); return EXIT_SUCCESS; /* EXIT_SUCCESS == 0 */ }
Result
Open