Google
 
Webcprogramming.com




An Affiliate of AIHorizon




ispunct()

Prototype: int ispunct (int c);
Header File: ctype.h (C) or cctype (C++)
Explanation: Tests if the ASCII character corresponding to the integer stored in c is a punctuation character.



#include &tl;iostream>
#include &tl;cctype>

using namespace std;

//Example reads in a character and tests if it punctuation
int main()
{
    char x;
    cin>>x;
    if(isspunct(x))
    {
        cout<<"Punctuation";
    }
    else
    {
        cout<<"Not punctuation.";
    }
}
Other Functions

Bookmark and Share



-----
Interested in advertising with us?
Please read our privacy policy.
Copyright © 1997-2005 Cprogramming.com. All rights reserved.
Designs