The role of the progress bar
The progress bar is the computer in the processing of files, real-time, in the form of pictures to show the speed of processing files, the completion degree, the size of the remaining outstanding files, and may need to process time, generally in a rectangular bar display, when the progress bar read to enter the next step, mainly in order to facilitate the user's patience and the exact progress of
Implementation of the progress bar under Linux
1. Establish the main function (Vim main.c)
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/82/28/wKiom1dNGTCRXWl1AABVkFqSIl0144.png-wh_500x0-wm_3 -wmp_4-s_1950842951.png "title=" qq picture 20160531124809.png "alt=" Wkiom1dngtcrxwl1aabvkfqsil0144.png-wh_50 "/>
2. Establish PROC.C (Implementation progress bar)
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/82/28/wKiom1dNGcXhwC_rAACUrwBxCm8276.png-wh_500x0-wm_3 -wmp_4-s_348537145.png "title=" qq picture 20160531125105.png "alt=" Wkiom1dngcxhwc_raacurwbxcm8276.png-wh_50 "/>
Note: bar[] is used to indicate progress, rate% can more specifically understand the progress of the program, Char *label to indicate whether the program continues to execute
3. Create a Makefile file (tell the make command how to compile the linker)
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/82/26/wKioL1dNG5OgCfumAABxXPgD5iI969.png-wh_500x0-wm_3 -wmp_4-s_4047703111.png "title=" Qq20160531125439.png "alt=" Wkiol1dng5ogcfumaabxxpgd5ii969.png-wh_50 "/>
4. Compile the link program (make)
650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M00/82/28/wKiom1dNHh6hqK5PAAB5WUTFx-A243.png-wh_500x0-wm_3 -wmp_4-s_4162662.png "title=" Qq20160531130939.png "alt=" Wkiom1dnhh6hqk5paab5wutfx-a243.png-wh_50 "/>
5. Execution procedure (./main)
650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/82/28/wKiom1dNHu6D6L0MAAATXinrfrA987.png-wh_500x0-wm_3 -wmp_4-s_4258506921.png "title=" Qq20160531131248.png "alt=" Wkiom1dnhu6d6l0maaatxinrfra987.png-wh_50 "/>
(Execution process diagram)
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/82/28/wKiom1dNIICCiqEzAAAiG0lD5YM215.png-wh_500x0-wm_3 -wmp_4-s_3759983076.png "title=" Qq20160531131952.png "alt=" Wkiom1dniicciqezaaaig0ld5ym215.png-wh_50 "/>
(Final execution result diagram)
This article from the "Learning Record" blog, reproduced please contact the author!
Linux environment using make and makefile implementation progress bar