22-12-2007, 23:48
|
|
|
|
חבר מתאריך: 18.10.05
הודעות: 311
|
|
בעיה גראפית בc++\c
אני רוצה ליצור מסך של הקלדת סיסמה הנקודה היא כזאת שאני רוצה להקיש מקש במסך גראפי
לדוגמא שלחצתי 'q' אז יוצג על המסך אבל הבעיה שאני לא יודע איך לקלוט את זה באופן שאוכל להדפיס את זה...
בגלל המסך הגראפי והפונקציה outtext
קוד:
char buffer[10];
char *p;
/* request autodetection */
int gdriver = DETECT, gmode, errorcode;
/* initialize graphics and local variables */
initgraph(&gdriver, &gmode, "c:\\tc\\bgi");
/* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk) { /* an error occurred */
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1); /* terminate with an error code */
}
/* There's space for 80 characters plus the NULL terminator */
buffer[0] = 81;
outtextxy("ENTER STRING");
p = cgets(buffer);
outtextxy(300,300,p);
getch();
return 0;
אנא ממכם עזרו לי רק בשתיים שלוש שורות איך אני קולט תו ומציג אותו על המסך חשוב לי שיהיה תו ולא מחרוזת על מנת שבעת ההקלדה יהיה ניתן להציג כאלו בזמן אמת הוספה ומחיקת תווים
תודה ובבקשה מראש
_____________________________________
|