i am trying to get the current time of day (calender time)
now where would the time be stored as an ascii string. what i really wanna do is send() so i have my own timeserver.Code:time_t current; ... time(current);
i am trying to get the current time of day (calender time)
now where would the time be stored as an ascii string. what i really wanna do is send() so i have my own timeserver.Code:time_t current; ... time(current);
Well, you probably don't want to send the date in string format. Send it/store it as a time_t (unsigned int??). But whatever, use ctime() or similar (you should browse time.h, too...). Remember, that ctime() returns a static buffer that will be overwritten in subsequent calls - be sure to copy the data immediately, and not simply store pointers to the returned strings...
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
>>now where would the time be stored as an ascii string.
You have to ask for it by way of ctime or localtime
Code:char *timestring = ctime(¤t);
*Cela*
thx for the response guys... i got it
Sebsatiani, i think u think that i am more advanced than i really am. in some time ill look back on what you said and see if i understand it. thx still.