Your problem is that scanf is a PoS when it comes to reading numbers. Your safest/sanest bet is to blow it out to two lines, do an fgets into char buffer and then use sscanf to strip your number into your size variable. If my recollection of the function is correct (probably not this early on a saturday), it will look something like:Note that you will get some strange looking output when you request your character (an additional line), but fixing that is up to you.Code:fgets(buffer, 5, stdin); sscanf(buffer, "%d", &size);



