Как я могу скопировать массив символов в другой массив символов?
Привет,
Есть ли способ или способ скопировать массив символов (например, размер 8) в массив символов (размер 64).
Что я уже пробовал:
Я уже пробовал использовать некоторые методы, такие как Array.Copy и copyto (), но это не сработало.
Мой результирующий массив символов всегда был/0 /0 /0 /0 .....
public int CAN_DefineTransmit(int canNo, int iD, int cycleMs, int offsetMs, int length, char[] frame) { int ret; this.ReadBuffer(); this.CANDIAG_CommandBufferInit(); this.buff.Param[1].IValue = canNo; this.buff.Param[2].IValue = iD; this.buff.Param[3].IValue = cycleMs; this.buff.Param[4].IValue = offsetMs; this.buff.Param[5].IValue = length; if ((length < 8 && length >= 0) || length > 8) { Array.Copy(frame, 0, this.buff.Param[3].FrameFD, 0, length); } else { Array.Copy(frame, 0, this.buff.Param[3].FrameFD, 0, 8); } // this.buff.Param[6].FrameFD = frame; ret = this.CANDIAG_Client_SendCommand(501); this.WriteBuffer(); return this.CANDIAG_CommandBufferExit(); }
Фрейм FD-это массив символов 64, объявленный в структуре.
Kornfeld Eliyahu Peter
Вы должны показать свой код...