Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-24-2004, 07:59 PM
x-scythe
Discordant
 
Join Date: Jun 2003
Posts: 449
Default help with C++

been here like a year now and decided i want to learn C++ so i can help out more.
ive been practicing a few things since some of it seems to be the same as PERL. i ran into an error tho...
what i want this simple program to do is ask people to type in a username and then i want it to ask them for a password. people who put the wrong pass in get this message "Incorrect Pass. Good-Bye." and people who put the right one get this message "You have accessed my information. You are lame!" For some reason tho, every time you put in your username you get the message you would get for a correct password instead of the "Enter Password" prompt.
heres is the code
Code:
//basic pass

#include <iostream.h>
#include <stdio.h>

int main()
{
	//enter username
	int name;
	cout << "Enter Username:";
	cin >> name;

	//enter pass
	int pass;
	pass = 5;
	cout << "Enter Password:";
	cin >> pass;

	if(pass != 5)
	{
		cout << "Incorrect Password. Good-bye.";
	}
	if(pass == 5)
	{
		cout << "You have accessed my information! You are lame!";
	}

	return;
}
thats it...any help would be appreciated greatly.

also if anyone could respond with what exactly the beginning "int main()" function does would also be appreciated hehe...i have no clue what its for. i know it has something to do with declarations maybe?
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 10:51 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3