You are not declaring/creating the name variable before you use it.
Your string constant ("QUIT) doesn't have the closing quotes (").
A real big problem, not a problem with your code, is not using code tags. PLEASE learn to use code tags when posting source code, they make reading and commenting on the code MUCH easier.
HINT, you can edit your post and add the code tags.
My bad all the typing errors weren’t in my actual code I’m typing this on phone and I have sausage fingers but this really helped thanks. I didn’t declare the variable.
#include <iostream>
#include <string>
int main()
{
for (std::string name; (std::cout << "Enter first name or enter QUIT to stop: ") && (std::cin >> name) && (name != "QUIT"); std::cout << name << std::endl);
}