Home » Community » Newbie corner » Casting from std::string to String
Casting from std::string to String [message #50355] |
Wed, 03 October 2018 11:51 |
Giorgio
Messages: 218 Registered: August 2015
|
Experienced Member |
|
|
Hi there,
maybe I did not get enough coffee today, but it seems that my brain can't overcome a very simple task: casting from std::string to String.
Here's the code:
std::vector<std::string> stdWords; //This actually comes from another application I cannot control
Upp::Vector<Upp::String> words;
words.Clear(); //This can be removed?
for(unsigned int i=0;i<stdWords.size();i++)
words.push_back(String(stdWords[i])); // I tried also words.push_back((String)stdWords[i]);
PromptOK(words[0]); //This is to see if casting worked: I should read something, instead I always get a blank prompt
After that I have this: "if(words[0]==name())". Name returns a String and I know that they are equal, but it always returns false. It really don't understand.
Thanks in advance,
gio
|
|
|
|
|
Goto Forum:
Current Time: Fri Sep 20 10:37:30 CEST 2024
Total time taken to generate the page: 0.03150 seconds
|