close
1. Declaration may not appear after executable statement in block
根據 ANSI C C90 standard 宣告變數的地方需要在執行任何code 之前
否則Keil 或者 Renesas CS+ IDE會產生error
2. 使用memcpy function in C/CPP
需#include <string.h>
使用方法:
// Copies "numBytes" bytes from address "from" to address "to" void * memcpy(void *to, const void *from, size_t numBytes)
與strcpy的差異
strcpy
stops when it encounters a NULL, memcpy
does not. You do not see the effect here, as %s
in printf also stops at NULL.
Reference:
http://www.keil.com/support/docs/3677.htm
https://www.geeksforgeeks.org/memcpy-in-cc/
https://stackoverflow.com/questions/2898364/strcpy-vs-memcpy
全站熱搜