I am trying to pass some url information into tokenize_urls from process_and_display_information. To get things up and running, I am simply trying to return and retain some array data from tokenize_urls into process_and_display information. However, I am running into an issue where the variables are created and sent back from tokenize_urls but they're only pointers, and so once it gets back to process_and_display_information, the data is gone. How do I actually capture new data that is created by tokenize_urls? Surely not with a global variable!
char * tokenize_urls()
{
char * my_strings[3] = {"first","second","third"};
return my_strings;
}
void process_and_display_information()
{
char * my_new_char = tokenize_urls();
cout << my_new_char << endl;
}