how to start a number with a specific number

there is a something specific how to start a number with a specific number like a and after whatever number ? like the job of *

1
2
3
4
5
cin>>id;
if (id = "1*")
cout<<"true";
else 
cout<<"false":
That was a bit tough to read OP, so please forgive me if I misunderstand. But I'm about 90% sure that what you want is called a "Regular Expression". They aren't that easy to use at first but they are definiatly worth learning: http://www.cplusplus.com/reference/regex/
If you are actually dealing with numbers (and not strings), there is also this:
http://stackoverflow.com/questions/17393757/how-to-retrieve-the-first-digit-of-number-efficiently
Topic archived. No new replies allowed.