當前位置:編程學習大全網 - 電腦編程 - C語言程序 怎樣在輸入其他時,而屏幕上顯示“*”?

C語言程序 怎樣在輸入其他時,而屏幕上顯示“*”?

#include <conio.h>

#include <stdio.h>

int main()

{

char pw[8], *p = pw;

for(int i = 0; i < 7; ++i, ++p)

{

*p = getch();

putch('*');

}

*p = 0;

printf("\n%s", pw);

}

  • 上一篇:如何讓手裏的小玩具飛上天?
  • 下一篇:神經網絡編程
  • copyright 2024編程學習大全網