ARDUINO MEGA Functions Miscellaneous
(→memcpy) |
(→memcmp) |
||
| Line 119: | Line 119: | ||
|- | |- | ||
|<syntaxhighlight lang="robotc"> | |<syntaxhighlight lang="robotc"> | ||
| − | + | char temp1[5] = {'A', 'B', 'C', 'D', 'E'}; //Create an Array | |
| − | + | short result = 0; //Variable to store result | |
| − | + | result = memcmp(temp1[0], temp1[2], 2); //Perform the memory compare | |
</syntaxhighlight> | </syntaxhighlight> | ||
|- | |- | ||
Revision as of 18:26, 9 May 2012
ARDUINO → Functions and Variables → ARDUINO MEGA Functions Miscellaneous
|
| |||||||
memcpy
| void memcpy(void &pToBuffer, const void &pFromBuffer, const short nNumbOfBytes) | ||||||||||||
| (void) Function copies characters from pFromBuffer to pToBuffer. nBytesToCopy is the number of bytes to copy. Identical to the function found in conventional C 'string.h' library. | ||||||||||||
| ||||||||||||
|
memset
| void memset(void &pToBuffer, const short nValue, const short nNumbOfBytes) | ||||||||||||
| (void) Sets a block of memory at pToBuffer to the value nValue. nNumbOfBytes is the number of bytes to set. This is a useful function for initializing the value of an array to all zeros. Identical to the function found in conventional C 'string.h' library. | ||||||||||||
| ||||||||||||
|
memcmp
| intrinsic short memcmp(void &pToBuffer, const shortnValue, const short nNumbOfBytes) | ||||||||||||
| (void) This function will compare | ||||||||||||
| ||||||||||||
|
memset
| void memset(void &pToBuffer, const short nValue, const short nNumbOfBytes) | ||||||||||||
| (void) Sets a block of memory at pToBuffer to the value nValue. nNumbOfBytes is the number of bytes to set. This is a useful function for initializing the value of an array to all zeros. Identical to the function found in conventional C 'string.h' library. | ||||||||||||
| ||||||||||||
|