% Libraries % Domhnall O'Hanlon % 10th March 2015
We've been using the C st__andar__d __i__nput __o__utput library for a while now, so let's take a closer look at what it contains and some of the other functions it gives us access too.
There are two functions that allow you to read and write single characters in the console.
getchar()
putchar()
puts() gets()
probably contains these: isalpha() isdigit() ...probably!
isupper() islower() //check for upper or lower case
toupper() tolower() //text transforms
use the functions to check if p/w contains upper case letter, lower case letter and "special" character
###string.h
Concatenation strcat(arg1, arg2),
arg1: string that you want to extend
arg2: string that you want to add onto arg1.
###math.h
floor() ceil() //not seal() - make this function!
returns an absolute value what the difference between modulus (little measure) and modulo? abs()
pow(n, exponent) //a la old school batman
returns the square root of n sqrt(n)
use these maths functions to solve for the roots of a qudratic equation.
generate a random number. rand()
luckyNums = (rand()%42) + 1 //same as dice game.
roll = (rand()%6) + 1 //returns 0-5 and adds one to it.
print out ASCII dice.
higher or lower?