If you want to iterate over the characters of the n
th entry in argv
:
int i;
int len = strlen(argv[n]);
for (i = 0; i < len; i++)
// do something with argv[n][i]
If you want to copy them somewhere else first (which is most likely not necessary) use strcpy()
or strdup()
.