Password Verifier errors

This snippet will be part of a larger program next semester. I have most of the errors corrected but these few, and they are escaping my fogged brain.
Thanks

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

#include<iostream>
#include<iomanip>

using namespace std;
bool password(char*);

void main()
{
	const int MAX_SIZE = 100;
	char string(MAX_SIZE); 

	cout << "Please enter a password. " << endl;
		cin.getline(string, MAX_SIZE);//this states it can't convert a char to char*

		if (password(string))//this states it can't convert a char to char* also
		{
			cout << "This is a good password. " << endl;
		}
			else
			{
				cout << "Please try again! " << endl;
			}
}
boolpassword(char *string);
bool uppercase = false, lowercase = false, digit = false;
{
	int count = strlen(string);//illegal use of an expression

	while (*string != NULL()); //just says "while"
	{
		if (isupper (*string[i])) uppercase = true;
		else if (islower (*string[i])) lowercase = true;
		else if (isdigit (*string[i])) digit = true;
		string ++;
	}
	return count>= 6 && uppercase && lowercase && digit;
)//missing a brace
char string(MAX_SIZE); this is what ?

cin.getline(string, MAX_SIZE); // getline is not available in this way

if (isupper (*string[i])) this is what ?

recommending to you:

http://www.cplusplus.com/doc/tutorial/
char string(MAX_SIZE); string is a type, this syntax looks like you want to declare a single char
named string with some extra operator

if (isupper (*string[i])) uppercase = true; I agree with above post and I dont see a declaration for
i

this is one of those cases where your errors are cause by not checking the steps in your code. Pick it apart and see whats wrong.

One more thing, and I will prob be corrected on this, but try:
#define MAX_SIZE 100
instead of const int MAX_SIZE = 100;
Topic archived. No new replies allowed.