|
|
| Line 1: |
Line 1: |
| − | <yambe:breadcrumb>ARDUINO_MEGA_Functions_and_Variables|Functions and Variables</yambe:breadcrumb> | + | {{DISPLAYTITLE:2560 (MEGA) Miscellaneous Functions}} |
| | + | <yambe:breadcrumb self=2560 (MEGA) Miscellaneous Functions>ARDUINO_MEGA_Functions_and_Variables|Functions and Variables</yambe:breadcrumb> |
| | <br /> | | <br /> |
| | | | |
| intrinsic short memcmp(void &pToBuffer, void &pFromBuffer, const short nNumbOfBytes)
|
| (void) Compares the first set bytes of the block of memory referenced by "pToBuffer" to the first number of bytes referenced by "pFromBuffer". The function will return zero if they all match or a value different from zero representing which is greater if they do not.
|
| Parameter
|
Explanation
|
Data Type
|
| pToBuffer
|
First buffer to compare.
|
void
|
| pFromBuffer
|
Second buffer to compare.
|
void
|
| nNumbOfBytes
|
Number of bytes to compare
|
short
|
|
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
|
|