Structured programming involves taking a single large task and breaking it into a group of intermediate pieces.
Then take each of those smaller intermediate pieces and continue breaking them into smaller groups of pieces (as needed) until you end up with the smallest functions that each do a single task. It's similar to making an outline for a speech.
Your code ends up looking like this:
main()
{
DoMainTask();
}
void DoMainTask()
{
DoTask1();
DoTask2();
}
void DoTask1()
{
printf{"this is Task 1, which is simpler than Task 2\n"
}
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.