You are right. A typedef is nothing more than a new name for a type, in that sense, it is an alias. And, it really is just a new name for a type, not a new type in and of itself. It serves the purpose of shortening names to make the code more readable, and to associate types as nested in a class declaration (see STL containers for examples). Typedefs are especially useful in generic programming and template meta-programming, because the names of the types tend to get very long (with many template arguments). They are also useful in template meta-programming to declare the results of meta-functions. But still, typedefs are just an alias for a type. In fact, this is what they are now referred to as in the new C++ standard, as type aliases, with a new syntax:
typedef std::size_t size_type; //old syntax (still valid in C++11, of course)
using size_type = std::size_t; //new syntax.
template <typename T>
using vect_type = std::vector<T>; //new syntax allows template aliases too.
I need to comput and display the sum and average of the cubes of the even natural numbers between 2 and n. Where n is entered by the user. Im stuck on how to average the sum of the cubes. Help Please. This is what I have so far.