Hey help me out.I couldn't do it.I am writing a code of setting up a pssword and use it to logein. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Hey help me out.I couldn't do it.I am writing a code of setting up a pssword and use it to logein.

Use structure programming and try it for me.at the same time how do u call an array that is in another function while u r not in main the use the if condition to compare it with the one u type in.

22nd Jul 2017, 9:01 AM
nattii
nattii - avatar
2 Answers
+ 1
If you don't want oop style, just declare global array of allowed passwords. in main just read user's input and in for cycle compare two strings using if statement and output the result. It is difficult to find out what you exactly need to do
22nd Jul 2017, 9:47 AM
soman
0
YeA but how do u do u the if statement. I have declared global array...char pass[5]; and I have function to get .cin>>pass; and I have login function with char log[5] cin>>log and compare with pass.???
23rd Jul 2017, 11:51 AM
nattii
nattii - avatar