Password Checking C++ Help VISUAL STUDIO 2010

My code runs on codepad http://codepad.org/dDI3fx92
but I get
1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
on Visual STudio. Can someone take a look?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iostream>
#include <string>
using namespace std;

bool password(char s[])
{
	int lenght = strlen(s);
	if(lenght >=8)
	{
		cout << "password good" << endl;
		return true;
	}
	else 
	{
		cout << "password no good"<< endl;
		return false;
	}
}

int main()
{
	char Pass[20]="goodness";
	password(Pass);
}
You configured your project incorrectly - When you ran the New Project Wizard, you selected Win32 Application instead of Console Application as the project template. To fix this, go to:

On the Toolbar, click on Project and select Project Properties. On the top of the window that is created, you'll see a drop-down menu labeled "Configuration." Change the value to "All Configurations." Then, in the pane on the left of the window, traverse to Configuration Properties->Linker->System.

In the right pane, you'll see a field labeled "Subsystem." It is currently set to Windows. Click the drop-down menu (arrow on the right) and select Console, and then run your program.

Also, you're likely to get a compile error for not returning from main (), but that's somewhat irrelevant.
Last edited on
thanks, main always work without a return value for me.
Topic archived. No new replies allowed.