int main(int argc, string argv)
char temp, temp1;
int num, i, j, n, x;
int key = atoi(argv);
if (argc > 2 || argc < 2)
Program needs to except one and only one command line arg and exit if more than one arg is passed at the prompt (which it does) and exit if no arg is passed. Now, when I enter more than one arg the program exits as it should. When I add the code in the if statement "|| argc < 2" I get a seg fault when I dont enter an arg @ the prompt. I'm lost. Ive tried just about everything I could think of. Any hints on how to make this work in the way that I described?
A good question. However when I ener an arg at the prompt the program works perfectly. I enter, ./caesar 13 (any int actually) and bam, works great. Name of the c file is caesar btw. The program was designed to accept one (int)arg, then use the int as the key for the caesar cipher.
I will admit there are gaps in my knowledge with respect to passing arguments at the prompt. Thats why Im here. Educate me.