I'm stuck with coming up how to create this program that lets you enter a sentence and then counts how many of the words it contained were by C++ approved variable names, and then outputs the amount.
What I mean by approved variable names is that when you declare a variable in C++, you can't name it "1name" or "ÅÄÖ", and this program should investigate if any of the words you've entered would've been valid variable names.
I've tried lots of things but the program either works incorrectly or does nothing at all. I wanted to be able to do this myself, but it feels like I won't ever be able to come up with a solution. I would be very grateful if someone could help me here. I can show you one of my failed solutions. I think the program gets stuck in a loop somewhere because nothing happens when I run it.
Your solution doesn't work correctly either, I think you need to read my explanation of the problem again, it isn't supposed to find the amount of words.