import java.util.Scanner;
class test {
public static void main (String [] args) {
Scanner in = new Scanner(System.in);
System.out.println("Input string is " + in.nextLine());
System.out.println("Input number is " + in.nextInt());
in.close();
}
}
Monday, September 21, 2009
Thursday, September 17, 2009
Sunday, September 13, 2009
Tips
* fgetc gets one character by character. So if you have 12 followed by newline written in a file, fgets will return 1 in the first call, 2 in the second call and 10 (for newline) in third call.
*fgets reads characters until it encounters a newline character. newline is considered as a valid character and therefore it is included in the string copied.
*fgets reads characters until it encounters a newline character. newline is considered as a valid character and therefore it is included in the string copied.
Subscribe to:
Posts (Atom)