[Code example] Echo second version page 115

User avatar

Topic author
BJT
Site Admin
Site Admin
Posts: 141
Joined: Thu Apr 20, 2017 4:43 pm
Instruction: University Student
Gender:
Age: 27
Venezuela

Echo second version page 115

Post by BJT » Wed May 03, 2017 6:57 pm

  1. #include <stdio.h>
  2.  
  3. /* echo command-line arguments; 2nd version */
  4. int main(int argc, char *argv[])
  5. {
  6.     while (--argc > 0)
  7.         printf("%s%s", *++argv, (argc > 1) ? " " : "");
  8.     printf("\n");
  9.     return 0;
  10. }

Execute in console the binary file

Code: Select all

.c/ Hello World
output

Code: Select all

hello world
word count: 54

Link:
BBcode:
HTML:
Hide post links
Show post links

Who is online

Users browsing this forum: No registered users and 1 guest