I want to make a check password program with password checking in another function. What should i change in line8 instead of return 0? I want the program to close the loop and resume int main when i enter the correct password.
Thanks
Line 8: You shouldn't be specifying an integer (0) as the return value of a function whose return type is string.
Line 12: You don't return anything if the check fails. This really should be a bool function.
Note the logical not (!) reversing the sense of check. This will keep the meaning of check straight-forward. true=pass, false=fail. The loop will now continue as long as check returns false.