Programming in C

(Barry) #1
Exercises 233


  1. Write a function called strToFloatthat converts a character string into a floating-
    point value. Have the function accept an optional leading minus sign. So, the call
    strToFloat ("-867.6921");


should return the value –867.6921.


  1. If cis a lowercase character, the expression


c – 'a' + 'A'

produces the uppercase equivalent of c, assuming an ASCII character set.

Write a function called uppercasethat converts all lowercase characters in a string
into their uppercase equivalents.


  1. Write a function called intToStrthat converts an integer value into a character
    string. Be certain the function handles negative integers properly.

Free download pdf