1 Star 0 Fork 0

Orient / linux-code

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
pro.c 379 Bytes
一键复制 编辑 原始数据 按行查看 历史
wzd_orient 提交于 2022-03-03 22:48 . linux第一个小项目:进度条
#include<stdio.h>
#include<string.h>
#include<unistd.h>
#define NUM 100
int main()
{
char bar[NUM + 1];
memset(bar,'\0',sizeof(bar));
int i = 0;
const char* lable = "|/-\\";
while(i <= 100)
{
printf("[%-100s][%d%%][%c]\r",bar,i,lable[i % 4]);
fflush(stdout);
bar[i] = '=';
bar[i+ 1] = '>';
i++;
usleep(50000);
}
printf("\n");
return 0;
}
C++
1
https://gitee.com/wzd_orient/linux-code.git
git@gitee.com:wzd_orient/linux-code.git
wzd_orient
linux-code
linux-code
master

搜索帮助