Monday, September 21, 2009

To take inputs from console - java

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();
}
}

Thursday, September 17, 2009

Setting environment variables in windows:
Open the Control Panel (Start ‣ Control Panel), start the System program. Click the Advanced tab and select the Environment Variables button. You can edit or add to the User Variables.

Sunday, September 13, 2009

ASCII character list : http://web.cs.mun.ca/~michael/c/ascii-table.html

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.