my program is to convert input char to phone no and will ask whether want to continue or not after conversion. I am managed to do conversion but my loop for continue or not is not working properly. For first time it worked but after first time it'll straight away go to continue and it won't let me input the data again.
ok now i can solve it for correct input part but if i key in wrong input it'll stop the program straight away instead of asking me whether i want to continue or not.
You need to add cin.ignore(80, '\n') after your last cin.get statements. This will discard anything left in the buffer before checking if you want to continue.
@ocasio101 cannot. if i change all to cin instead of cin.get() it won't capture white space which needs to convert to -. now i think it's something wrong with my coding in checking of wrong input part. because everything i key in anything other than a-z,A-Z and - it'll straight away terminate the program. I can still see the continue statement but it won't let me key in whether i want to continue or not.
ofcourse you can get that.
White space works like end of word but like you can compare a to \n,same way you can compare it to space.Space is (char)32 .