I am sure that I am way off on this but I could use some help. I need to make a program that will print my name "x" amount of times passed from the command line. But if a number greater than 10 is passed to display an error. Here is what I have, probably no where near what I need.
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main (int argc, char* argv[])
{
int i;
if(argc > 10)
{
printf("Usage: error can not print more than 10 times.\n");
pritnf("Exiting program.\n");
exit(0);
}
else
{
for(i=0;i<argv[1];++i)
{
printf("zekiegypt\n");
}
}
return(0);
}