'how can i get the length of argv[1]

not sure how I should get the string length from the argv[1], I think the problem is with the argv[i] but I can't seem to find anything to help with this

if(argc <2) 
{
    printf("please enter a file name!");
}
printf("%s",argv[1]);


char source[] = {argv[1]};

char destination;
int start = 0;
int len = 0;

for(int i =0; i< strlen(argv[1]);i++)
{       
    if(argv[i] != ' ')
        len++;  
}

printf("%d",len);


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source