FAQ: Functions - Parameters & Arguments

After not understanding this lesson and banging my head against it for awhile I think I understand better what is happening. I was confused because I thought this was about functions changing Main variables but I think this is about main variables changing functions. at least when i thought about it that way the example code you have to do made a lot more sense to me, and I hope this can help someone.

This lesson starts with a function to determine a tip amount, it gives me this argument example:

double get_tip(double price)

Then is asks me to create a void function with a string argument

void get_emergency_number(string emergency_number)

I was banging my head, trying to figure out why it wasnt printing the number, come to find out you have to type:

get_emergency_number(std::string emergency_number)

Where was this in the lesson? I think I may have missed this. :frowning:

1 Like

The instruction of this lesson is supper unclear, and I could not have figure it out without looking at the solution.