Páginas

Mostrando las entradas con la etiqueta ANSI C. Mostrar todas las entradas
Mostrando las entradas con la etiqueta ANSI C. Mostrar todas las entradas

domingo, 21 de julio de 2013

Hello World

How to say Hello World with style

Language C
 
#include <stdio.h> //Library for using standard input and output

int main(int argc, char* argv[]){ //function main which is executed first when the program is invoked
                                  //it receives 2 parameters, the first one is the counter of arguments
                                  //the second one is an array of arguments from command line

  printf("Hello world!\nby %s\n", argv[1]); //We say Hello and print the second parameter from char array argv[] of
                                            //arguments from command line

  return 0; //the function returns the integer zero and everything it's ok
}//End of the program