You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#include <stdlib.h> //getenv, atoi
|
|
#include <stdio.h> //printf
|
|
|
|
int main(){
|
|
// pointer to a char
|
|
char *repstext=getenv("reps");
|
|
int reps = repstext ? atoi(repstext) : 10;
|
|
|
|
char *msg = getenv("msg");
|
|
if (!msg) msg = "Hello.";
|
|
|
|
for (int i=0; i< reps; i++)
|
|
printf("%s\n", msg);
|
|
}
|