Click here to Skip to main content
15,885,435 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
i want to save 10000 record in a file using myfile.write but information didnt save correctly . this is myfile:
[code]
جج^ى_±ؤ‏/ ¯– 
   p p îى_±         P‎û7           0     ˆ‏/    ے/ گ ’=|±    ج‏/ ك" ط‏/ "ٌv P‎ے/ )´+w P‎›َ u         P‎            ن‏/     ےےےےUص'w3    $    0ے/ ü³+wè  P‎                è  P‎                                                                                                                                                                                                ü=L×>
îےîے    ¨ p  p   p   0  
  @ 0   @ î   
       ً1 ً1 مـ5‍ك>
¨xH ےےےے                ط1 ط1       p                                  

 [/code]

can anyone help?
Posted
Updated 22-Jun-11 23:31pm
v3
Comments
Sandeep Mewara 23-Jun-11 5:25am    
Can you try and write in English please?
Manfred Rudolf Bihy 23-Jun-11 5:34am    
Hope that the garbage on my screen is not due to viewing this on my Samsung Galaxy Tablet ;-)
Prerak Patel 23-Jun-11 5:36am    
How do you write to file? Share code.
Joan M 23-Jun-11 5:40am    
Add code just to allow us to see/imagine what can be going on.
Moreover it would be great to know which kind of data you want to store and how you want to retrieve it from the file...
ShilpiP 23-Jun-11 5:40am    
Please share your code write data in file.

You are writing a structure (the data of myclass) which contains various integer values by the look of it and expecting to read it as characters. This will never work; you need to read it back into a myclass object and decode the values as appropriate.
 
Share this answer
 
Comments
zahraZa 23-Jun-11 13:41pm    
thanks a lot,
but i don't want to use .read because user must can read records that saved in file(address of records in the file are random).File saveF must be readable.if i use txt file i should write field by field of my class(true?)if this is true can i access to record by random address ?
i don't know what should to do!!!!! :(
thanks for your help
Richard MacCutchan 24-Jun-11 4:04am    
If you want random access then you should not be using streams (continuous stream of bytes) but some ordinary or structured file type. See here for information on using the FILE type in C.
Use XML to store Unicode data. also use CData to to put it into a node.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900