why my time is error ? help help help

//this coding is need to user enter detail.. after that, to put the password.. if password is correct, the program will show the detail.. but if the password wrong, will be loop until the password correct.. HELP ME..!!

#include <iostream>
using namespace std;
int pass (int);
int Details(char);
double come_back_time (double);
int time (int);

int main ()
{
cout<<"****************************************************************"<<endl;
cout<<"\t\tWelcome to Smart Home Co."<<endl;
cout<<"****************************************************************"<<endl;

char user[30];
char ic_number[30];
char house_name[30];
double come_back_time;

cout<<"User Name :";
cin>>user;
cout<<"IC Number:";
cin>>ic_number;
cout<<"House Name :";
cin>>house_name;
cout<<"Come Back Time(in 24 hour format) :";
cin>>come_back_time;
cout<<pass;


return 0;

}
double time (double t)
{
double time;
t = time;
if (t <= 17.00)
{
cout<<"Early";
}
else
{
cout<<"Late";
}

return time;
}


int pass (int a)
{


a=1234;
int *pass=&a;
cout<<"Please Enter Your Password: ";
cin>>a;

return a;
}

void Details()
{
int pass,ic_number;
double come_back_time;
char user;
double t;
if (pass = true)
{

cout<<"**************************************************************"<<endl;
cout<<"Welcome "<<user<<endl;
cout<<"Your ic number is : "<<ic_number<<endl;
cout<<"Your come back time today is :"<<come_back_time<<endl;
cout<<"Your are :"<<t<<endl;
}
else
{
cout<<"Sorry,You are not the owner on this house.Please enter your password again"<<endl;
}
}
I don't really see where you're using a time function to pull the current time, and also it looks like your function prototype is int and looking for int input, but when you actually put together you function is a double.

1
2
// your prototype
int time (int);

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//your function
double time (double t)
{
double time;
t = time;
if (t <= 17.00)
{
cout<<"Early";
}
else
{
cout<<"Late";
}

return time;
}


also I've been playing around with ways to make it compare times... you should check out
http://www.cplusplus.com/reference/clibrary/ctime/difftime/
and combine it with
http://www.cplusplus.com/reference/clibrary/ctime/mktime/
I'm a bit of a newb, so I didn't put together anything spectacular here, but I figured since no one had answered you yet I would throw in my 2 cents, for what it's worth.
Well, the program seems to compile. But there is a great deal wrong with it.
For example, this line: cout<<pass;
What does it do? It outputs the address of the function called pass().

Perhaps a review of the use of functions would be a good plan:
http://www.cplusplus.com/doc/tutorial/functions/
Topic archived. No new replies allowed.