今天收获的知识。。。。。。

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");

 


     

你可能感兴趣的:(今天收获的知识。。。。。。)