User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







cpp:cctype:isascii
click
to support this page (eg 0,42 € or so) Thanks.

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
advertising
cpp/cctype/isascii.txt · Last modified: 2012/10/12 15:03 (external edit)

Impressum