On this page
  1. isspace
  2. Include
  3. Signature & Overview
  4. Notes & Pitfalls
  5. Example

isspace

Prev: isalpha | Up: ctype.h | Next: tolower
Rel: ctype.h, Arrays & C Strings
Ref: cppreference — isspace
Tags: #public #prog #c #stdlib #ctype #tier/core


Include

#include <ctype.h>

Signature & Overview

int isspace(int ch);

Returns non-zero for whitespace (' ', '\t', '\n', '\r').

Notes & Pitfalls

Example

#include <assert.h>
#include <ctype.h>

int main(void) {
    const char *p = "   hello";
    while (*p && isspace((unsigned char)*p)) p++;
    assert(*p == 'h');
}

Linked from

Related notes