There is a code tag on the forum you could use to make your code look nicer.
char* str = "Something like this\n";
I'd also recommend you completely scratch your method of doing things and use SFML's built in classes (which are nice).
I think you want something like sf::IntRect (http://www.sfml-dev.org/documentation/2.2/classsf_1_1Rect.php) or something in that family. It has a function that checks the intersections for you and then from there you can check the top/bottom/left/right sides etc. There is more information in the documentation.