I am trying to make a password lock program in DEV C++ my compiler does not agree with this program. pls i am not able to solve this one
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
#include<iostream>
#inlcude<conio.h>
#include<string.h>
#include<stdio.h>
using namespace std;
int main()
{
char A[20];
cout<<"Enter your password \n";
gets(A);
if(strcmp(A,"Thanosbuster")==0)
cout<<"Welcome Mr Stark";
else
cout<<"Intruder alert";
Sleep(9000)
cls
}
|
Last edited on
You forgot a ;
on line 15 , and on line 16, Cls
is just meaningless.
oh yeah everything else is fine right?
You could use
<thread>
to make use a thing similar
to
Sleep()
:
1 2 3 4 5 6 7
|
#include <thread>//sleep_for and this_thread
#include <chrono>// seconds
int main(){
std::this_thread::sleep_for(std::chrono::seconds(1));
std::cout << "yay!";
}
|
They both kinda hold for a bit.
Last edited on