Scanner c/c++ code failed