ovviamente quel cast in char* non è corretto, come converto time.wHour (di tipo WORD) in stringa?codice:int main(){ SYSTEMTIME time; GetLocalTime(&time); char date[32] = "orario:"; strcat(date,(char*)time.wHour); }
ovviamente quel cast in char* non è corretto, come converto time.wHour (di tipo WORD) in stringa?codice:int main(){ SYSTEMTIME time; GetLocalTime(&time); char date[32] = "orario:"; strcat(date,(char*)time.wHour); }
il word è un unsigned short.. quindi mi sa che basta la itoa
grazie, ma ho usato sprintf, itoa non è standard e il mio compilatore non la vedeOriginariamente inviato da Stoicenko
il word è un unsigned short.. quindi mi sa che basta la itoa
Al solito... snprintf, che vai sul sicuro.
Amaro C++, il gusto pieno dell'undefined behavior.