Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

input value from terminal to c

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
   int rings;
   if(argc != 2) {
       printf("Usage: %s number-of-rings
",argv[0]);
       return 1;
   }

   rings = atoi(argv[1]);
   printf("Using number-of-rings = %d
", rings);
...

   return 0;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #input #terminal
ADD COMMENT
Topic
Name
9+6 =