Visual C++ HELP..!!

Joined
Sep 22, 2005
Messages
29
Reaction score
7
i have search google and Microsoft for if then else statement in Visual C++, but i didn't found anything (have even tr.ied if C# if then else statement worked).. So do someone of you know how to do if then else statement in Visual C++??


This was the if then else statement i tried, but when i
tried compilet it did only give me this
error C2451: conditional expression of type 'void' is illegal..

if (textBox1->Text = "123") {
Application::Exit();

else {
label1->Text = "Wrong Password";
 
Last edited:
Well, I see one problem, you didn't close any of the functions with **, I'm not much of a c++ wiz but I know that is wrong. If you are looking for some simple c++ tutorials look at www.cprogramming.com, and a direct link to if then statements is here.

EDIT: Why can I not type in the curly braces?
 
Last edited:
If this is the actual code
Code:
				if (textBox1->Text = "123") {
					Application::Exit();

				else {
					label1->Text = "Wrong Password";

where are the closing braces for this portion?
 
Back