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);
Printable View
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...
>>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);
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.