I am making a program in which a user has to enter his username and password inorder to access the main program.....i am making the user enter the password using the getpass function and i have included the necessary headerfiles i.e. <conio.h>

do
	{
		cout<<"\n\n SIGN IN \t\t";
		cout<<"\n\n\n Username \t\t"; gets(uname);
		while(!f.eof())
		{
			pos=f.tellg();
			f.read((char*)&u,sizeof(u));
			if(strcmp(uname,u.getuname())==0)
			{
				found=1;
				char*pass;
				pass=getpass("\n\n Password \t\t");
				if(strcmp(pass,u.getpswrd())==0)
				cout<<"\n\n You may Proceed \t";
				else
				{
					cout<<"\n\n Incorrect Password \t\t";
					break;
				}

the following errors appear

call to undefined function getpass
cannot convert "int" to "char*" in function sign_in()[the name of the function]

Never use gets for input, you can overrun the end of your input buffer and crash your program, etc. Use fgets instead, if you must use the C library functions.

I'm having a hard time understanding how the snippet you posted relates to either getpass or sign_in (I get that you call getpass in it but where is it defined?)

(this sounds harsh but I really didn't intend it that way at all)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.