hi guys..i have this code to count a character within a given source file..why wont it run/(it doesnt seem to compile either)
import java.io.IOException;
class Main
{
public static void main(
String args[] )
{
try
{
int count = 0;
int ch = System.in.read();
while ( ch == '/')
{
count++;
ch = System.in.read();
}
System.out.println( "Total number of characters: " + count );
}
catch ( IOException err )
{
System.out.println("Unexpected error on
input");
}
}
}
any help?
also i have this code (below) for calculating the lines in a source code (any random source code) how can i combine both codes (above and below) to produce code that will calculate the amount of logical lines in a source code?
ive asked b4, given it ago, but im stuck at this point..can i get the answer???
thanks guys for your time and effort
cheers
tom
