Hi all - can anyone explain how i could delete a character at the end of a string (char*), namely "\n". I have a function that gets the time ...
void GetTime(char *ti) {
time_t rawtime;
struct tm *timeinfo;
char *timedata;
time ( &rawtime ); /* Get the time */
timeinfo = localtime ( &rawtime );
timedata = asctime(timeinfo);
strcpy(ti,timedata); /* Copy the time string */
}
.. Which works o.k. but returns the time WITH a carrage return - my problem is that i need the string, without it.
Any help would be appreciated,
Regards,
J@yb0t.
"Always know what you say, but don't always say what you know!"
void GetTime(char *ti) {
time_t rawtime;
struct tm *timeinfo;
char *timedata;
time ( &rawtime ); /* Get the time */
timeinfo = localtime ( &rawtime );
timedata = asctime(timeinfo);
strcpy(ti,timedata); /* Copy the time string */
}
.. Which works o.k. but returns the time WITH a carrage return - my problem is that i need the string, without it.
Any help would be appreciated,
Regards,
J@yb0t.
"Always know what you say, but don't always say what you know!"