30. How Can I Better Organize My Programs?

Using Functions

image

Typical computer programs are not the 20-to-30-line variety that you see in textbooks. In the “real world,” computer programs are much longer; but long programs contain lots of code that would get in the way while learning new concepts. That is why, until this point, you’ve seen fairly short programs that contain all their code in main().

If you were to put an entire long program in main(), you would spend a lot of time to find anything specific if you later needed to change it. This chapter is the first of three chapters ...

Get Absolute Beginner’s Guide to C, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.