I have a function for adding a new profile as below.
bool Main_window::add_new_profile(char* f_name_entered)
{
char* l_name_entered;
// skipped some portion
bool m_status = throw_m_dialog("Enter New Profile Name",l_name_entered);
// skipped some portion
if(m_status)
// skipped rest of the function
The throw_m_dialog function in header file
bool throw_m_dialog(char* f_label, char* f_name);
The throw_m_dialog function
bool throw_m_dialog(char* f_label, char* f_name)
{
Glib::ustring l_text;
//skipped some portion
g_input_dialog_label->set_text(f_label);
// skipped some portion
if(l_response==Gtk::RESPONSE_OK)
{
l_text=g_input_text->get_text();
f_name=(char*)l_text.data();
return true;
}
// skipped the cancel part
My problem is that i get some unreadable characters. I guess i am reading the address. How do i update the profile name from the throw_dialog function?