0

I have trouble with isdigit() function, I get error for line 27-else loop:

#include <cs50.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

int main(int argc, string argv[])
{
        int k = atoi(argv[1]);  

        if (isdigit('k'))

        {
            string s = GetString();
            for(int i=0, n=strlen(s); i<n; i++)
            printf("%c", i);

        } 
            printf("\n");

        else
        {
            printf("1\n");
            return 1;
        }

   return 0;
}

any help there please? thanks

2

You must log in to answer this question.

Browse other questions tagged .