#include <stdio.h>
#include <stdlib.h>
#include <Windows.h>
int main(void)
{
char rotate[]= "|/-\\";
char* ptr;
ptr = &rotate[0];//指向数组首地址//
int i = 0;
printf("加载中:");
while (i < 1000)
{
printf("\b%c",*ptr++);//使用指针来获取当前指向的地址并按顺序移动//
if (*ptr == '\0')// 如果移动到字符串的结尾则重新指向数组首地址//
{
ptr = &rotate[0];
}
fflush(stdout);//强制输出//
Sleep(100);//每隔0.1秒继续输出//
i++;//i递增//
}
return 0;
}