I\'m trying to read user input of integer. (like cin >> nInput; in C++) I found io:fread bif from http://www.erlang.org/doc/man/io.html, so I write code like this.
Try printing the number with ~w instead of ~p:
~w
~p
1> io:format("~w~n", [[10]]). [10] ok 2> io:format("~p~n", [[10]]). "\n" ok
The ~p format specifier tries to figure out whether the list might be a string, but ~w never guesses; it always prints lists as lists.