You guys are thinking too hard about this program; he made an infinite loop. Obviously, x is always going to be greater than or equal to zero, so the return 0 will never execute. That's what Uberlord was commenting on. Usually, returning a number is good for debugging and properly making commands for Unix, especially if you want something that can be piped. AFAIK, it returns 0 when the program runs successfully, and returns something else when there's a problem. Of course, you have to determine what to return if the program fails, so you have make other values that you can return. And no, you shouldn't learn about classes first. You really have to learn the basic syntax and the usage of functions before you go onto class, structs, and dynamic memory allocation.