Okay so in the PrintName function, it contains a printf function. However, I read that printf returns a value which is the number of characters. Shouldn't PrintName hence return an int as well? Thanks!
Good question. There is no requirement to capture a return value. Just because a function returns a value doesn't mean that the calling code needs to do anything with it. For many functions, like printf, it is common to disregard the return value. However, when there are bugs in a program, those return values can become useful in diagnosing and debugging.
To extend the concept, what if a function calls multiple other functions that all return values, maybe even different value types. What is it supposed to return then? Again, there's no requirement to return anything. It's up to the programmer to decide what, if anything, to return.
If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)