Question

I am using the memcpy() function using the ARM EABI compiler. As I see in the file, the function is defined as

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.
    */

Please forgive my ignorance;as I am not much familiar with C and pointers in general.Could someone please detail me what does it mean by const void * and does those syntaxes (like __attribute etc.) need to be maintained while calling the function?

Thanks!

My implementation:

char mycharacter;
mycharacter = ROM_UARTCharGetNonBlocking(UART0_BASE);
memcpy(SRAM_BASE, mycharacter, size_t (mycharacter);
Was it helpful?

Solution

The whole point of having a standard library is that you don't have to understand the implementation to use the function.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top