I'm writing a program to validate credit card numbers. I call three high level functions in the main. One of my functions (isValid) validates the arithmetic of the credit card number, and within this function there are three other functions- one that sums even digits, one that sums odd, and one that divides them by 10. When I am defining isValid, how would I define the "subfunctions" within it? Where would I place them in the program?
You would declare it the same way you declared isValid(). To define it you could do one of two things. Either define it above the function you intend to call it from, of declare it above the function you intended to call it from and define it elsewhere. The compiler reads top down, so anything that is used the compiler must know about before you can use it.