0
HELP ME PLS!!! How to make a programm something like this.
I need password-type safe programm but i dont know how to make looping (repeat write password, when human wrote password, BUT DONT USE While OR For. This commands spam write a password!!!)
27 Antworten
0
if(strcmp(q, "Test")==0) Replace if cond with this and include string.h
+ 3
it compares the value of q to "Test"
+ 2
https://code.sololearn.com/cjJG2wK2eoD9/?ref=app
Don't run it on SL, it won't execute properly.
Use TC++ or CodeBlocks or any other app you have but not SL
+ 2
YES!!! Thanks. But can you make for android this one?
+ 1
Use goto
again:
cout<<"Write a Password";
cin>>pass;
goto again;
+ 1
goto again is code?
+ 1
Yes
+ 1
write a code for me pls!
if you make all correct I become subscritor.
+ 1
Because gets(); dont work on my phone, maybe you know a another command for android?
+ 1
None will work on SL other than cin
+ 1
OK. THANKS! I YOU SUBSCRITOR!
+ 1
code::blocks only for pc?
+ 1
Yes
+ 1
what for android?
+ 1
CppDroid
+ 1
thanks.
+ 1
You best!
+ 1
#include <iostream>
#include <cstdio>
#include <string.h>
using namespace std;
int main() {
char q [250];
again:
cout << "Print command";
gets(q);
if(strcmp(q, "Test")==0){
cout << "Tested";
}else{
cout << "Unknown command!";
}
goto again;
return 0;
}
+ 1
what mean strcmp in if?
0
i need this programm:
example:
(programm): write a password.
(human): 1234
(programm): incorrect.
(programm): write a password.
(human): 4321
(programm): correct.
(programm): write a password.