#include
#include
#include
int main(int argc, char *argv[]){
int fir; //badly named loop variable
char *in
argv
is an array of char, strlen
only takes strings. If you want to get the length of each argument in argv
(which is what I was trying to do), you must iterate through it, accessing the elements like so argv[i][j]
. Using the argument argv[i][j] != '\0'
. If you just want the number of arguments use argc
.