?? spin.cpp
字號:
// Created:10-27-98
// By Jeff Connelly
// Spinning cursor function
// Set 'read_byte' global function pointer to a function containing a
// call to this and a call that actually reads the byte. Example:
// unsigned char my_read_byte()
// {
// spin();
// return read_byte();
// }
#include "stdafx.h"
#define EXPORTING
#include "comprlib.h"
// 'spin' "spins" the characters 'chars' after this is called 'speed' times.
// Default spin characters are |/-\, so it looks like it is spinning.
void EXPORT spin(int speed = 10, char chars[] = "|/-\\\0")
{
static int counter = 0, index = 0;
++counter;
++index;
if (counter == speed)
counter = 0;
else
return;
if (!chars[index])
index = 0;
printf ("%c\b", chars[index]);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -