0
我有字符數組,其具有在它下面的字節數:損耗字節*
output[0] = 0
output[1] = 0
output[2] = 4
output[3] = -46
output[4] = 0
output[5] = 0
output[6] = 0
output[7] = 0
當我通過這個陣列以下功能作爲第二paramater
this->refServer->Transmit(ConnectionId,output);
void Server::Transmit(int ConnectionIndex, const char* MessageToSend)
該數組變成空值。我猜數組在被轉換爲const char *時被修剪爲第一個空字符,但我不知道如何在不改變輸出字節的情況下防止這種情況發生。
不,它不是「修剪」。這個問題是在別的地方(試圖在字符串函數中使用數組?另一種類型?) – SJuan76
與將其設置爲const char *無關。您正在使用期望以空字符結尾的字符串的函數。 – chris