c++ - Seg Fault with SOCI -


so haven't been coding in c++ quite while now, i'm pretty sure issue related soci , not general knowledge of memory usage in c++. here problem : i'm using soci query table , field, , sql statement line cause segmentation fault. quite troublesome... here code :

string engine::getreview(int rev_id)  {     try {         session sql;         string post;          sql.open("mysql", "db=ranking_dev user=****** password=*******");         sql << "select post reviews id = 3", into(post); //faulty line          return post;     }     catch (exception const &e) {         cerr << "error: " << e.what() << '\n';         return "";     } } 

i'm positive line root of error. tried initialize "post" variable, no avails. also, if retrieve integer value table (and store data in integer), there's no seg fault. , guess issue related way i'm using string, can see overly wrong in function. ideas on this?


Comments

Popular posts from this blog

unicode - Are email addresses allowed to contain non-alphanumeric characters? -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

c++ - Convert big endian to little endian when reading from a binary file -