cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Character Restriction
Character Restriction
Oct 31, 2009 at 2:14pm UTC
BloodMetal
(4)
How can I restrict the user to input characters for e.g. if I ask them for a number?
Oct 31, 2009 at 4:22pm UTC
Duthomhas
(13206)
This is a very common question, asked about once a week.
Here's a fancy response.
http://www.cplusplus.com/forum/beginner/13044/page1.html#msg62827
Lines 29 through 41 are the ones that should interest you most.
Perhaps I ought to make an article about this. Oh wait, someone already did:
http://www.cplusplus.com/forum/articles/6046/
(Sorry if I sound rude. That is not my intention.)
I'm still thinking about an article for this though...
Oct 31, 2009 at 4:46pm UTC
BloodMetal
(4)
Thank you Duoas for the reply, I also had one more question, I tried declaring a string but it seems that Visual C++ Express 2008 doesn`t recognize is. Is
string s;
the right way to declare it or do I have to do something else? Thanks again.
Oct 31, 2009 at 8:01pm UTC
Bazzy
(6281)
You need to
#include<string>
If you are not
using
namespace
std;
add
std::
before
string
Topic archived. No new replies allowed.