Hello,
I have a function which calculates time for a specific operation and prints the time...
However i want to call the time in another function and display its value...
The code is as follows:-
int encrypt()
{
double encryptTime,Add,sub,sft,mix;
// add + sub + sft + mix calculations
encryptTime = Add + sub + sft + mix;
printf("Encrytion Time : ");
printf("%lf ", encryptTime);
printf("seconds.");
printf("\n\n");
return 0;
}
I am getting the correct time...that is its working..The output is as follows:-
0.000142 seconds
Now i have to call this encryptTime from another function:-
double dTime()
{
double encryptTime;
return (encryptTime);
}
I am getting the time as:-
-9.25596e+061 seconds
In the main function
int main()
{
encrypt();
dTime();
return 0;
}
Can anyone help how we can solve this problem...