注意我是初學者。睡眠(4000)顯示。每1000(C++)
我想要做的是顯示一個「。」定時器每1000秒鐘。我想要「。」在cout後面顯示。
#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
char uname;
char pword;
cout << "Initializing EKG";
Sleep(4000);
/* while/for Sleep(1000) cout << "."
while Sleep(1000*2) cout << "."
*/
//Something along those lines I am trying to achieve.
//Can't I use a ++ or something similar to increase the . to .. to ... to ....?
return 0;
}
有時我想知道人們是否在撰寫問題時看預覽。 – rightfold 2014-10-27 22:38:55
'睡眠'以毫秒爲單位,而不是幾秒,它的價值。 – 2014-10-27 22:55:46
哪個平臺和操作系統?你可能想要一個單獨的線程執行一個打印'。'的函數。每一秒。這將允許您的程序打印'。'同時執行其他操作。 – 2014-10-27 22:57:08