Your function: char * loadFromFile(char * file)
returns char pointer which points to local variable s (std::string). That s variable goes out of scope at the end of your function, hence you get garbage. C++ is already hard language and adding usage of raw char to it is asking for trouble. Do yourself a favor and use std::string instead of char *.
Some reading to get you started at http://en.cppreference.com/w/cpp/language/scope