Sponsored Content
Full Discussion: isspace?
Top Forums Programming isspace? Post 42737 by Perderabo on Monday 3rd of November 2003 01:16:26 PM
Old 11-03-2003
Well the code looks ok to me. I downloaded it and wrote a little wrapper. It works with both c and c++.

The only way that I can see this happening is a 64 bit/32 bit mismatch. Under that scenario, isspace would be returning a 32 bit integer. But b_space would want a 64 bit integer. So it grabs the correct 2 bytes (which are zero) and it grabs two more bytes which are not zero.
 

We Also Found This Discussion For You

1. UNIX for Dummies Questions & Answers

Isspace

Hey gurus.. I am still struggling with unix.. whats is the equivalent of isspace function in Unix shell scripting. I came across situation where a variable is a fixed lenth. And if it contains only spaces, then i should flag it as error. for eg.. vartemp=" " if isspace(vartemp)... (7 Replies)
Discussion started by: vipas
7 Replies
CTYPE(3)						     Library Functions Manual							  CTYPE(3)

NAME
isalpha, isupper, islower, isdigit, isxdigit, isalnum, isspace, ispunct, isprint, isgraph, iscntrl, isascii, toupper, tolower, toascii - character classification macros SYNOPSIS
#include <ctype.h> isalpha(c) . . . DESCRIPTION
These macros classify ASCII-coded integer values by table lookup. Each is a predicate returning nonzero for true, zero for false. Isascii and toascii are defined on all integer values; the rest are defined only where isascii is true and on the single non-ASCII value EOF (see stdio(3S)). isalpha c is a letter isupper c is an upper case letter islower c is a lower case letter isdigit c is a digit isxdigit c is a hex digit isalnum c is an alphanumeric character isspace c is a space, tab, carriage return, newline, vertical tab, or formfeed ispunct c is a punctuation character (neither control nor alphanumeric) isprint c is a printing character, code 040(8) (space) through 0176 (tilde) isgraph c is a printing character, similar to isprint except false for space. iscntrl c is a delete character(0177) or ordinary control character (less than 040). isascii c is an ASCII character, code less than 0200 tolower c is converted to lower case. Return value is undefined if not isupper(c). toupper c is converted to upper case. Return value is undefined if not islower(c). toascii c is converted to be a valid ascii character. SEE ALSO
ascii(7) 7th Edition May 12, 1986 CTYPE(3)
All times are GMT -4. The time now is 04:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy