OK, as you can probably tell from my code, I am trying to design a program that will keep requesting a password until the right password is entered (using a Do While Loop with char instead of int).
this is my code: (this is one of my first solo pieces of coding, so go easy on me if I have done something completely wrong, as I am quite knew to this.)
#include<iostream.h>
using namespace std;
int main()
{
char pass[6];
pass[0] = 'p';
pass[1] = 'a';
pass[2] = 's';
pass[3] = 'q';
pass[4] = 'w';
pass[5] = 'e';
do
{
cout<< "Enter Password:" <<endl;
cin>>pass;
}
while(pass!=pass[0],pass[1],pass[2],pass[3],pass[4],pass[5]);
return 0;
}
I am not to sure about the:
(pass!=pass[0],pass[1],pass[2],pass[3],pass[4],pass[5]);
as this was just me fiddling around with arrays etc.
When i try and compile it as it is, i get the error message:[/B]
Error E2034 cannot convert 'char' to 'char*' in function main ()
Any suggestions? :confused:
Thank you in advance :)