So I am doing the practice for functions. It ask to
Declare and define a function brew_tea()
that:
- has no return value
- has an
std::string
parameter oftea_type
- prints
"Brewing <tea_type> tea"
to the terminal
My code is as follows
#include <iostream>
std::string brew_tea(std::string tea_type);
std::string brew_tea(std::string tea_type) {
return "Brewing " + tea_type + " tea";
}
int main() {
std::cout << brew_tea("masala");
}
This will print out
Brewing masala tea
yet it gives me this error
Did you declare a void
function brew_tea()
with an std::string
parameter of tea_type
?
when i declare it as void it get errors which do not show any output
Where am i going wrong?