TF1 with a function written by the user?

Hi, I want to create a macro that takes a function written by the user in cmd and draws it with TF1:

void DrawFunction(function)
{
     TF1* fa1 = new TF1("fa1", function, 0, 10);
     fa1->Draw(); 
}

but I have tried different options but I have always error.

TF1 Class Reference