If you have your objects in an appropriate container (
http://cplusplus.com/reference/stl/ - vectors are probably the simplest to learn), you can just for loop through it.
object would be your vector of objects
for (int i = 0; i < object.size(); i++)
{
//if object is lower than 20 pixels above the player and is higher than the player...
if (object[i].getY > playerY - 20 && object[i].getY < playerY)
{
//object must be one unit above the player
{
//check other sides
}
It's more than likely that you will need something more complex than that, but it's the basic idea. Bear in mind that this if condition will be true any time the object is in the row above the player, you will have to cross check it with X(columns) for a proper result.
Might I suggest using square tiles/objects/player for simplicity?
rogue**