Total members 11893 |It is currently Tue Nov 05, 2024 4:29 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Hello

I create a file (display.txt) with content:

Code:
identity:identity number:endidentityname:Enter Your
identity:identity number:endidentityname:Enter Your
identity:identity number:endidentityname:Enter Your


The follow method try read from "display.txt" char by char until end of file.
for this proposal i perform casting: (char)in.read()
my problem is how method knows where is the end of file
while((c = (char)in.read()) != "????what suppose be here?????" )

kindly see method bellow:

File inputFile = new File("C:/ADELANTE/divelog/src/divelog/display.txt");

   public void MeabedFile()
        {
           try
         {
          char c;
          FileReader in = new FileReader(inputFile);      
          while((c = (char)in.read()) != "????what suppose be here????" )
          {
             System.out.print(c);
          }
                                       in.close();
         }
         catch (IOException e)
         {   
         }
        }
         

:banghead: :banghead: :banghead: :banghead:




Author:
Newbie
User avatar Posts: 1
Have thanks: 0 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : casting to char + end of file
 File read by char     -  
 convert char*(number) to required unsigned char*     -  
 Casting Variables in php     -  
 Array Casting in java     -  
 Set Implode char     -  
 Draw char with color in php     -  
 String char count     -  
 range of the char type     -  
 Encrypt/Decrypt a file from source file to target file.     -  
 Copy file to file in java code- implementation     -  



cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com