2013年10月5日星期六

A basic question about IO

 This post last edited by the u011823854 on 2013-10-05 03:28:27
source file is written to the following:

Figure 1: Open the source file after ...... I was shocked ...... full TNND garbled ......


Figure 2: I can not understand is ...... source file full of garbage ...... here is how can properly read the entire contents of the file ?


Figure 3: This is the console output in Figure 2

---------------------------------------------- ------------
---------------------------------------------- ------------

Then I used another way to write the same code

Figure 4: wicked problem came ...... this can not properly read the source file decimal and string contents


Figure 5: Figure IV console output


string-related code in the comment before the system throws an exception as follows:

Figure 6: seeking science ...... these anomalies represent what ?

Why do these problems occur ? ! Novice ...... seeking science ...... do not spray ah ......
------ Solution ---------------------------- ----------------
you write is utf-8 encoded string , you do not tell the editor is utf-8 format , of course, is garbled. Using tools such as open textpad , and set utf-8 encoding format , should be able to view the source files .
------ Solution ---------------------------------------- ----
you write according to the order read. Write your order is int, String, double. Should also be read in the order in this order .
------ For reference only -------------------------------------- -
problem solving ...... thank two !

没有评论:

发表评论