今天收穫的知識。。。。。。

1。在dos窗口中顯星號

#include   "stdio.h"

      int   main(int   argc,   char*   argv[])  
  {  
   
  char   password[20],c;  
  int   i   =   0;  
  while(1)  
  {  
  c   =   getch();  
  if(c   ==   13)  
  break;  
  password[i++]   =   c;  
  printf("*");  
  }  
  password[i]   =   '/0';  
  printf("/nThe   input   password   is   %s/n",password);            getch();
  return   0;  
  }  

 

2。c++中的getch()在"conio.h"頭文件中

3。若要讓程序暫停若干秒,需要用Sleep()。調用該函數需要#include"windows.h"

如Sleep(1000);   //暫停1秒

4。dos窗口清屏用system("cls");

 


     

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章