Thread: HeLp PlEaSe

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    7

    Question HeLp PlEaSe

    is there a fuction in C that is used for counting spaces in a character string(in a paragraph)?

    Also how can u add tthe number of spaces in a paragraph?.which fuction to use?

  2. #2
    Registered User Sargnagel's Avatar
    Join Date
    Aug 2002
    Posts
    166
    7.4.1 Character classification functions
    1 The functions in this subclause return nonzero (true) if and only if the value of the
    argument c conforms to that in the description of the function.

    ...

    7.4.1.3 The isblank function
    Synopsis
    1 #include <ctype.h>
    int isblank(int c);
    Description
    2 The isblank function tests for any character that is a standard blank character or is one
    of a locale-specific set of characters for which isspace is true and that is used to
    separate words within a line of text. The standard blank characters are the following:
    space (' '), and horizontal tab ('\t'). In the "C" locale, isblank returns true only
    for the standard blank characters.

    ...

    7.4.1.10 The isspace function
    Synopsis
    1 #include <ctype.h>
    int isspace(int c);
    Description
    2 The isspace function tests for any character that is a standard white-space character or
    is one of a locale-specific set of characters for which isalnum is false. The standard white-space characters are the following: space (' '), form feed ('\f'), new-line
    ('\n'), carriage return ('\r'), horizontal tab ('\t'), and vertical tab ('\v'). In the
    "C" locale, isspace returns true only for the standard white-space characters.
    Last edited by Sargnagel; 11-10-2002 at 10:22 AM.

Popular pages Recent additions subscribe to a feed