Can you put a string in a called function, where the string is in the parameter? In C++?

For example,

void call(test)
{
if test = "hello"
{
cout << "hi";
}
}

void main()
{
call("hello")
}

would I get an output of "hi"?

2015-02-21T14:37:00Z

forgot to add & next to void call(&test), if it matter...but the main question is would "hello" be passed?

?2015-02-21T14:42:04Z

Favorite Answer

yes
#include <string>

void call(std::string const & test)
{
if (test == "hello")
{
cout << "hi";
}
}