By the way, what do you press to build ad upload?
If there isn't any confusion over which project you are building and upload then I would be looking at memcmp as the culprit. But as I have said arduino.cc are the best people to help with code.
const uint8_t SLAVE_0[] = { 0xAA, 0xAA, 0xAA, 0xAA, 0xAA };
const uint8_t SLAVE_1[] = { 0xBB, 0xBB, 0xBB, 0xBB, 0xBB };
const uint8_t SLAVE_2[] = { 0xCC, 0xCC, 0xCC, 0xCC, 0xCC };
void setup()
{
purchase(SLAVE_2);
}
void purchase(const uint8_t* slave)
{
if (memcmp(slave, SLAVE_1, 5))
Serial.println("Purchasing SLAVE_1");
if (memcmp(slave, SLAVE_2, 5))
Serial.println("Purchasing SLAVE_2");
}
other things to look for at times like this.
make sure you haven't got any stray code files in the project folder that are not included in the project. If you have then remove them or include them in the visual studio project.
look in the build folder that is shown in the verbose build output and see what actual code has been compiled in the project_name.cpp. The project_name.cpp in the build folder should contain a copy of the code from the .ino file(s) of the project. That will be the last code that was compiled. If that matches your expected code then the issue is code.