mercredi 18 décembre 2019

Could you help me understand the following code :

is *argv[1] a way to go over all elements of an array

#include <unistd.h>

int     main(char **argv)
{

    while (*argv[1])
    {
        if (*argv[1] == 'a')
        {
            write(1, "a", 1);
            break;
        }
        argv[1]++;
    }
}

what about argv[1]++ : is it to add one to the address

Aucun commentaire:

Enregistrer un commentaire