How to check whether a given wide character is a hexadecimal number in C

1 Answer

0 votes
#include <stdio.h>
#include <wchar.h>

int main(void)
{
    wchar_t wch = L'f';

    if (iswxdigit(wch) > 0) {
        wprintf(L"Hexadecimal\n");
    }
    else {
        wprintf(L"Not hexadecimal\n");
    }

    return 0;
}




/*
run:

Hexadecimal

*/

 



answered Jul 31, 2022 by avibootz

Related questions

1 answer 180 views
1 answer 172 views
1 answer 149 views
1 answer 209 views
1 answer 155 views
1 answer 225 views
...