Protection Input(HELP)

I need protection input for decimal number.
Terms:input of decimal +/- number;
at start of input mustn't be ".";
after input 0(at start),write ".";
after first "." mustn't be entered second ".";
if user enter second ".",program deletes to the first ".";

I'm beginner so it would be good to write in beginner's style :D
If someone help me,i will be very grateful! :)
Read the "number" as a std::string and then parse it according to needed rules. When you finish convert it using std::stringstream.
Topic archived. No new replies allowed.