I am writing a short program in c on a linux platform which takes an argument from the command line. My only problem is retrieving that argument. It is an integer.
Here's what is currently in my code:
int seconds = *argv[0];
Thanks :cheesy:
EDIT: Here is the rest of my code:
#include <sys/time.h>
#include <stdio.h>
int main(int argc, char *argv[]){
struct timeval theTime;
int timePassed = 0;
gettimeofday(&theTime, NULL);
int time = theTime.tv_sec;
int seconds = *argv[0];
printf("%d", seconds);
while(timePassed!=seconds)
{
timePassed = theTime.tv_sec - time;
gettimeofday(&theTime, NULL);
}
}