跳到主要內容

The best flow chart to help c/c++ programmer convert chart to code


Many computer language programmers all know that flow chart is a vital job for program development. But they seldom prepare a program flow chart prior to coding the program. Maybe some did prepare the chart , but rarely updated the chart when finished debugging or revised a new version. Why everyone knew it's important but most of them didn’t draw it ?
I guess most programmers didn’t like to maintain two ideas which are different in many aspect. Flow chart is rough and real code is precise, the former is easy, block by block, the latter complicated, line by line.  Novice found that it is very difficult to sync flow chart with source code ,senior already got the key point and didn’t want to waste time to draw chart or update the previous one.
I kept thinking this question for many years. There must be some missing link between flow chart and source code. But where ?  Finally, After reading Graphs, Algorithms, and Optimization written by W. L. Kocay & D. L. Kreher. I concluded some ideas.
I think the main difference is general flow chart belongs to 2-dimension structure which was designed for human understanding. See Fig 1. 
Beginners have difficulty to handle decision branch and ending of decision. The flow chart is too easy to show some real condition, such as “else” .  But source code belong to one-dimension structure which only fit computer operation. One solution sequence of Fig 1  , please see Fig 2. 
Fig 2 Program Sequence


How can we convert disperse flow chart  to one-side flow chart ?

Refer to above book, using algorithm structure skill. I introduce a convenience way to design flow chart for coding easily . Please see Fig 3.  When we draw the flow chart, we arrange the block similar to sequence order, You may find it very helpful to code the program and update new version . Please compare Fig 2 to Fig 3. 

@More examples please link here !