Originally posted by 1UP
Actually that is not the same. == "" will only check for a blank entry. A whitespace isn't considered empty. You may not have written this to have people tell you how to code but when people are actually giving you good information and correcting you when you are wrong you don't need to be an asshole.
Not going to put Script up on the spot but ... Script, you were going on about being proficient in C++ and acting about as though you were good in programming just a few days ago to me. A good programming takes criticism and 1UP is correct, you don't need to be an asshole.
I'm not the best programmer in the world but the way that I get better and better at programming is that I research, I listen to other people and I accept the facts that if I am doing something wrong, I need to fix it. There is always better ways to go about coding, if you're coding something quickly just to test, that is one thing but if you are presenting something as an example, follow the basics of programming.
Trust me, I've made my fair share of mistakes and I got called out on it and was mocked (granted they were being snobby pieces of shit given they had 10-15 years of experience on me) but that's aside the point. Accept the mistakes, take the criticism and make yourself better.
If you never learn to do so, you will never improve. You will never make it in the industry and well, you will find that you will have a hard time programming. A beginners book in programming only teachers the basic essentials. There are full document libraries that will have even better methods to getting things done.
The method I showed you above is actually something I just learned about a few months ago after looking for a better way to do what you were attempting above. Take what you learn and use that knowledge.