este es la parte del codigo donde se implementa este codigo en la funcion void password() de la linea 77 el bucle while(!kbhit() && j < 10000) se encuentra en la linea 99
Código
#include <stdio.h> #include <windows.h> #include <conio.h> void gotoxy(int x,int y); void marcos(int x1, int y1, int x2, int y2); void texto(char* txt, int x, int y); int largoCadena(char* cadena); void titulo(char* titulo, int x, int y); void username(int x, int y, char** user); void password(int x, int y, char pass[]); int main(){ char* user; char pass[11]; marcos(20, 7, 60, 17); titulo("Logger", 80, 6); texto("Username:", 22, 12); texto("Password:", 22, 13); username(32, 12, &user); password(32, 13, pass); texto(user, 22, 19); texto(pass, 22, 20); return 0; } void gotoxy(int x,int y){ HANDLE hcon; hcon = GetStdHandle(STD_OUTPUT_HANDLE); COORD dwPos; dwPos.X = x; dwPos.Y= y; SetConsoleCursorPosition(hcon,dwPos); } void marcos(int x1, int y1, int x2, int y2){ int i, j; for(i=y1; i<=y2; i++){ for(j=x1; j<=x2; j++){ gotoxy(j,i); } } } void texto(char* txt, int x, int y){ gotoxy(x,y); } int largoCadena(char* cadena){ int i = 0; while(cadena[i] != '\0') i++; return i; } void titulo(char* titulo, int x, int y){ x = x/2; x -= largoCadena(&(*titulo))/2; gotoxy(x,y); } void username(int x, int y, char** user){ gotoxy(x, y); } void password(int x, int y, char pass[]){ char tecla; int i = 0; gotoxy(x, y); do{ int j = 0; pass[i] = '\0'; if(tecla == 8 && x > 32){ x--; i--; gotoxy(x, y); gotoxy(x, y); }else if(tecla != 13 && tecla != 8 && i < 10){ pass[i] = tecla; //gotoxy(x, y); while(!kbhit() && j < 10000) j++; gotoxy(x, y); x++; i++; } }while(tecla != 13); }
· Corregida la etiqueta de codigo para hacerla más legible (con GeSHi)
· Los titulos deben ser descriptivos
>aquí las reglas del foro
-Engel Lex