Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#ActualZaoshi Kaba

Posted 01 December 2012 - 07:57 AM

  • You should Google "Why you shouldn't use Dev-C++".
  • More lines != less efficient
  • String and integer are very different, so you have to convert it somehow, stringstream is one of ways. Even if other languages allow to simply put variable name in the string, internally it still does something similar to this.

You can create function that'll convert it:
template<typename T>
string to_string(T v) {
	stringstream str;
	str << v;
	return str.str();
}

#2Zaoshi Kaba

Posted 01 December 2012 - 07:57 AM

  • You should Google "Why you shouldn't use Dev-C++".
  • More lines != less efficient
  • String and integer are very different, so you have to convert it somehow, stringstream is one of ways. Even if other languages allow to simply put variable name in the string, internally it still does something similar to this.

You can create function that'll convert it:
template<typename T>
string to_string(T v) {
	stringstream str;
	str << v;
	return str.str();
}

#1Zaoshi Kaba

Posted 01 December 2012 - 07:54 AM

  • You should Google "Why you shouldn't use Dev-C++".
  • More lines != less efficient
  • String and integer are very different, so you have to convert it somehow, stringstream is one of ways. Even if other languages allow to simply put variable name in the string, internally it still does something similar to this.
  • You can create operator (string operator+(string, int)) that'll automatically convert integers, but it's not quite safe.

PARTNERS