Skip to main content
deleted 74 characters in body; edited tags; edited title
Source Link
kzidane
  • 17.7k
  • 3
  • 28
  • 100

Question about why argc[1] and not argc[2] is `key` in `. Just finished pset1, caesar/caesar key` my second or third command-line argument?

i hope this is an ok subject to talk about. I don't need help with athe pset, since iI have finished it nowalready. For a while in caesar, I was getting a segmentation fault and. after changing argc[2] to argc[1] i managedargv[2] to get past itargv[1], the problem was solved.

But myMy question is why,: if I use argv[2] to take 3my command line-line arguments (in my caseare ././, caesarcaesar and a key)key, why is my key the 2nd argumentkey is in argv[1] and not the 3rd oneargv[2]?

Question about why argc[1] and not argc[2]. Just finished pset1, caesar

i hope this is an ok subject to talk about. I don't need help with a pset since i have finished it now. For a while in caesar I was getting a segmentation fault and after changing argc[2] to argc[1] i managed to get past it.

But my question is why, if I use argv[2] to take 3 command line arguments (in my case ./, caesar and a key), is my key the 2nd argument and not the 3rd one?

is `key` in `./caesar key` my second or third command-line argument?

I don't need help with the pset, since I have finished already. in , I was getting a segmentation fault. after changing argv[2] to argv[1], the problem was solved.

My question is: if I my command-line arguments are ./, caesar and key, why is my key is in argv[1] and not argv[2]?

Source Link

Question about why argc[1] and not argc[2]. Just finished pset1, caesar

i hope this is an ok subject to talk about. I don't need help with a pset since i have finished it now. For a while in caesar I was getting a segmentation fault and after changing argc[2] to argc[1] i managed to get past it.

But my question is why, if I use argv[2] to take 3 command line arguments (in my case ./, caesar and a key), is my key the 2nd argument and not the 3rd one?