Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Casting from std::string to String
Casting from std::string to String [message #50355] Wed, 03 October 2018 11:51 Go to previous message
Giorgio is currently offline  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

 
Read Message
Read Message
Read Message
Previous Topic: RLOG in Linux
Next Topic: MoveableAndDeepCopyOption inherite to use a VectorMap ?
Goto Forum:
  


Current Time: Thu Mar 28 23:56:25 CET 2024

Total time taken to generate the page: 0.01707 seconds