I have the following code:
unsigned char* originaldata = (unsigned char*)malloc(50);
strcpy((char*)originalData,"12345 7");
unsigned char* replacingData = (unsigned char*)malloc(9);
strcpr((char*)replacingData,"11111111");
memset(replacingData,6,6);
Then, I want to replace the data from position 6 till end of originalData with replacingData.
How could i do this in C code?
Although, it should be noted that this makes the assumption that
originalDatais always greater than 6 characters long and thatreplacingDatais longer than 6 characters shorter thanoriginalData.