:help:
ragazzi il programma che vi ho postato qui sotto mi da prblemi nell'esecuzione del confronto della password se è sbagliata.. qualcuno mi potrebbe aiutare??? grz
programma in C:
---------------
#include<stdio.h>
#include<conio.h>
char pw[4];
char num[4];
int fine=0;
void arr()
{
pw[0]=60;
pw[1]=61;
pw[2]=62;
pw[3]=63;
}
void conf_pwd()
{
int b,c,w,tent;
clrscr();
c=0;
tent=3;
for(b=0;b<4;b++)
{
if(num==pw-11)c++;
}
if(c==4)
{
clrscr();
gotoxy(30,12);
cprintf("PASSWORD esatta");
fine++;
}
if(c!=4)
{
gotoxy(30,12);
cprintf("PASSWORD errata");
tent--;
if(tent>0)
{
gotoxy(30,15);
cprintf("Rimangono %d tentativi",tent);
delay(2000);
}
if(tent==0)
{
clrscr();
gotoxy(30,12);
cprintf("Programma bloccato");
fine++;
}
}
}
main()
{
int a=0;
while(fine==0)
{
clrscr();
arr();
gotoxy(33,10);
cprintf("Inserire PASSWORD:");
gotoxy(35,12);
asm mov CX,4
pwd:
asm {
mov AH,07h
int 21h
}
num[a]=_AL;
a++;
asm {
mov DL,42d
mov AH,02h
int 21h
loop pwd
}
conf_pwd();
}
getch();
}
------------
fatemi sapere presto dell'errore
grz iko :)
ragazzi il programma che vi ho postato qui sotto mi da prblemi nell'esecuzione del confronto della password se è sbagliata.. qualcuno mi potrebbe aiutare??? grz
programma in C:
---------------
#include<stdio.h>
#include<conio.h>
char pw[4];
char num[4];
int fine=0;
void arr()
{
pw[0]=60;
pw[1]=61;
pw[2]=62;
pw[3]=63;
}
void conf_pwd()
{
int b,c,w,tent;
clrscr();
c=0;
tent=3;
for(b=0;b<4;b++)
{
if(num==pw-11)c++;
}
if(c==4)
{
clrscr();
gotoxy(30,12);
cprintf("PASSWORD esatta");
fine++;
}
if(c!=4)
{
gotoxy(30,12);
cprintf("PASSWORD errata");
tent--;
if(tent>0)
{
gotoxy(30,15);
cprintf("Rimangono %d tentativi",tent);
delay(2000);
}
if(tent==0)
{
clrscr();
gotoxy(30,12);
cprintf("Programma bloccato");
fine++;
}
}
}
main()
{
int a=0;
while(fine==0)
{
clrscr();
arr();
gotoxy(33,10);
cprintf("Inserire PASSWORD:");
gotoxy(35,12);
asm mov CX,4
pwd:
asm {
mov AH,07h
int 21h
}
num[a]=_AL;
a++;
asm {
mov DL,42d
mov AH,02h
int 21h
loop pwd
}
conf_pwd();
}
getch();
}
------------
fatemi sapere presto dell'errore
grz iko :)