Domanda

Sto usando la funzione MemCPY () usando il compilatore ARM EABI.Come vedo nel file, la funzione è definita come

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

Si prega di perdonare la mia ignoranza; poiché non ho familiarità con c e puntatori in generale. A qualcuno ti preghiamo di dettagliarmi di cosa significhi con Const Void * e quelle sintassi (come __attribute ecc.) Devono essere mantenute durante la chiamataLa funzione?

Grazie!

La mia implementazione:

char mycharacter;
mycharacter = ROM_UARTCharGetNonBlocking(UART0_BASE);
memcpy(SRAM_BASE, mycharacter, size_t (mycharacter);
.

È stato utile?

Soluzione

L'intero punto di avere una libreria standard è che non è necessario comprendere l'implementazione per utilizzare la funzione.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top