HELP ME PLS!!! How to make a programm something like this. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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!!!)

4th Oct 2017, 5:52 PM
ya_Bob_Jonez
27 Answers
0
if(strcmp(q, "Test")==0) Replace if cond with this and include string.h
5th Oct 2017, 4:45 AM
Kartikey Sahu
Kartikey Sahu - avatar
+ 3
it compares the value of q to "Test"
5th Oct 2017, 5:32 AM
Kartikey Sahu
Kartikey Sahu - avatar
+ 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
4th Oct 2017, 6:07 PM
Kartikey Sahu
Kartikey Sahu - avatar
+ 2
YES!!! Thanks. But can you make for android this one?
4th Oct 2017, 6:09 PM
ya_Bob_Jonez
+ 1
Use goto again: cout<<"Write a Password"; cin>>pass; goto again;
4th Oct 2017, 6:01 PM
Kartikey Sahu
Kartikey Sahu - avatar
+ 1
goto again is code?
4th Oct 2017, 6:03 PM
ya_Bob_Jonez
+ 1
Yes
4th Oct 2017, 6:04 PM
Kartikey Sahu
Kartikey Sahu - avatar
+ 1
write a code for me pls! if you make all correct I become subscritor.
4th Oct 2017, 6:05 PM
ya_Bob_Jonez
+ 1
Because gets(); dont work on my phone, maybe you know a another command for android?
4th Oct 2017, 6:12 PM
ya_Bob_Jonez
+ 1
None will work on SL other than cin
4th Oct 2017, 6:14 PM
Kartikey Sahu
Kartikey Sahu - avatar
+ 1
OK. THANKS! I YOU SUBSCRITOR!
4th Oct 2017, 6:15 PM
ya_Bob_Jonez
+ 1
code::blocks only for pc?
4th Oct 2017, 6:16 PM
ya_Bob_Jonez
+ 1
Yes
4th Oct 2017, 6:16 PM
Kartikey Sahu
Kartikey Sahu - avatar
+ 1
what for android?
4th Oct 2017, 6:17 PM
ya_Bob_Jonez
+ 1
CppDroid
4th Oct 2017, 6:18 PM
Kartikey Sahu
Kartikey Sahu - avatar
+ 1
thanks.
4th Oct 2017, 6:18 PM
ya_Bob_Jonez
+ 1
You best!
4th Oct 2017, 6:20 PM
ya_Bob_Jonez
+ 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; }
5th Oct 2017, 5:07 AM
Kartikey Sahu
Kartikey Sahu - avatar
+ 1
what mean strcmp in if?
5th Oct 2017, 5:28 AM
ya_Bob_Jonez
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.
4th Oct 2017, 5:52 PM
ya_Bob_Jonez