How to implement Java “Scanner” in C++?

You seem to be using Scanner to read one integer at a time from the standard input stream. This is easily accomplished with the extraction operator, operator>>. Replace this code: With this: You should check the value of std::cin after the >> operations to ensure that they succeeded. Refs: http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Scanner.html http://en.cppreference.com/w/cpp/io/basic_istream/operator_gtgt

KeyPressed event in java

Depending on where you want to trap the “enter” key, you could use an ActionListener (on such components such as text components or buttons) or attach a key binding to you component This will rely on the component being focused.

atoi in java using charAt

char digit = (char)(tmp.charAt(i) – ‘0’); In the ascii table, characters from ‘0’ to ‘9’ are contiguous. So, if you know that tmp.charAt(i) will return a character between 0 and 9, then subracting 0 will return the offset from zero, that is, the digit that that character represents.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)