t14BCharactersAndStringFunctions

t14BCharactersAndStringFunctions - Characters and Strings...

Info icon This preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Dale Roberts Characters and Strings Functions www.kite-legends.blogspot.com
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Dale Roberts Character Handling Library Character Handling Library Character handling library Character handling library Includes functions to perform useful tests and Includes functions to perform useful tests and manipulations of character data manipulations of character data Each function receives a character (an Each function receives a character (an int int ) or ) or EOF EOF as an as an argument argument The following slide contains a table of all the The following slide contains a table of all the functions in functions in <ctype.h> <ctype.h> www.kite-legends.blogspot.com
Image of page 2
Dale Roberts Character Handling Library Character Handling Library Prototype Description int isdigit( int c ) Returns true if c is a digit and false otherwise. int isalpha( int c ) Returns true if c is a letter and false otherwise. int isalnum( int c ) Returns true if c is a digit or a letter and false otherwise. int isxdigit( int c ) Returns true if c is a hexadecimal digit character and false otherwise. int islower( int c ) Returns true if c is a lowercase letter and false otherwise. int isupper( int c ) Returns true if c is an uppercase letter; false otherwise. int tolower( int c ) If c is an uppercase letter, tolower returns c as a lowercase letter. Otherwise, tolower returns the argument unchanged. int toupper( int c ) If c is a lowercase letter, toupper returns c as an uppercase letter. Otherwise, toupper returns the argument unchanged. int isspace( int c ) Returns true if c is a white-space character—newline ( '\n' ), space ( ' ' ), form feed ( '\f' ), carriage return ( '\r' ), horizontal tab ( '\t' ), or vertical tab ( '\v' )—and false otherwise int iscntrl( int c ) Returns true if c is a control character and false otherwise. int ispunct( int c ) Returns true if c is a printing character other than a space, a digit, or a letter and false otherwise. int isprint( int c ) Returns true value if c is a printing character including space ( ' ' ) and false otherwise. int isgraph( int c ) Returns true if c is a printing character other than space ( ' ' ) and false otherwise. www.kite-legends.blogspot.com
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Dale Roberts String Conversion Functions String Conversion Functions Conversion functions Conversion functions In In <stdlib.h> <stdlib.h> (general utilities library) (general utilities library) Convert strings of digits to integer and floating- Convert strings of digits to integer and floating- point values point values Prototype Description double atof( const char *nPtr ) Converts the string nPtr to double .
Image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern