Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

use of alphanumeric function c++, check if alphabet or digit from string

// Program to illustrate iswalnum() function
#include <cwctype>
#include <iostream>
using namespace std;
  
int main()
{
  
    wchar_t ch1 = '?';
    wchar_t ch2 = 'g';
  
    // Function to check if the character
    // is alphanumeric or not
    if (iswalnum(ch1))
        wcout << ch1 << " is alphanumeric ";
    else
        wcout << ch1 << " is not alphanumeric ";
    wcout << endl;
  
    if (iswalnum(ch2))
        wcout << ch2 << " is alphanumeric ";
    else
        wcout << ch2 << " is not alphanumeric ";
  
    return 0;
}
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #alphanumeric #function #check #alphabet #digit #string
ADD COMMENT
Topic
Name
9+8 =