Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) return type

 

The return type of a function denotes the data type it returns.

 

For example, the function below, ToInt, returns an int, so its return type is int.

 

#include <string>

///ToInt converts a std::string to an integer
///From http://www.richelbilderbeek.nl/CppToInt.htm
const int ToInt(const std::string& s)
{
  return std::atoi(s.c_str());
}

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict