Search:

Type: Posts; User: helloworld922

Search: Search took 0.06 seconds.

  1. Replies
    13
    Views
    4,723

    Re: Convert C/C++ code to Java

    Fields = data members :P

    Global is a concept when programming in C/C++ (and quite a few other languages) that meant everything had access to that variable. The reason it doesn't show up in Java is...
  2. Replies
    13
    Views
    4,723

    Re: Convert C/C++ code to Java

    :P there are no such things as "global" variables in Java, only object/class fields.
  3. Replies
    13
    Views
    4,723

    Re: Convert C/C++ code to Java

    hmm. i'm going to assume that the method bit() gets a input of 0/1, then converts it to a number, right?

    If so, you can use the .nextInt() method of the Scanner class, and then just see if value...
  4. Replies
    13
    Views
    4,723

    Re: Convert C/C++ code to Java

    If you want to extract each character, use the .charAt() method

    // get the first character
    header.charAt(0);
  5. Replies
    13
    Views
    4,723

    Re: Convert C/C++ code to Java

    hmm, the one thing I can see is wrong is using DataInputStream to get user input from System.in. This is causing Java to hang because technically, there's no end to the System.in stream. Instead, use...
Results 1 to 5 of 5