>Try clearing the stream by using 'cin.sync();' before 'cin.get();'.
Um, no. cin.sync() isn't guaranteed to do anything meaningful, much less "clear" the stream. The only portable way to read and discard leftover characters is to read them either with a loop, or with cin.ignore():
// Loop
char ch;
while ( cin.get ( ch ) && ch != '\n' )
;
// Ignore
#include <ios>
#include <limits>
cin.ignore ( numeric_limits<streamsize>::max(), '\n' );