我正在使用 ARM EABI 编译器的 memcpy() 函数。正如我在文件中看到的,函数定义为
extern _ARMABI void *memcpy(void * __restrict /*s1*/,
const void * __restrict /*s2*/, size_t /*n*/)
__attribute__((__nonnull__(1,2)));
/*
* copies n characters from the object pointed to by s2 into the object
* pointed to by s1. If copying takes place between objects that overlap,
* the behaviour is undefined.
* Returns: the value of s1.
*/
请原谅我的无知;因为我一般不太熟悉 C 和指针。有人可以详细说明一下 const void * 是什么意思吗?在调用函数时是否需要维护这些语法(如 __attribute 等)?
谢谢!
我的实现:
char mycharacter;
mycharacter = ROM_UARTCharGetNonBlocking(UART0_BASE);
memcpy(SRAM_BASE, mycharacter, size_t (mycharacter);