User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







cpp:cctype:isascii

isascii

    int isascii(int char);

a macro that tests if a char a ASCII char (0-127) is

cpp Sourcecode Example

/* 
 * isascii example code
 * http://code-reference.com/cpp/cctype/isascii 
 */
#include <iostream> /* including standard library */
#include <string> 
#include <cctype>
 
using namespace std;
int main ( void )
{
  int i;
  string str="Test ÖÄ%1";
  for (i=0; i <= 11;i++)
    {
     if ( isascii(str) != 0 )
      {
       cout << "character" << i << " isascii" << endl;
      }
    }
  return 0;
}

output

  output:
  character 0 isascii
  character 1 isascii
  character 2 isascii
  character 3 isascii
  character 4 isascii
  character 9 isascii
  character 10 isascii
  character 11 isascii

on the occasion of the current invasion of Russia in Ukraine

Russian Stop this War
cpp/cctype/isascii.txt · Last modified: 2024/02/16 01:04 (external edit)

Impressum Datenschutz