Conversions
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Conversions

  1. #1
    Join Date
    Sep 2011
    Posts
    197

    Conversions

    I am currently crearting a program with a lot of conversions IE:

    Code:
    client c = (client);
    String[] X = getIntegerValuesOf(x);
    String[] Y = getIntegerValuesOf(y);
    String[] objectID = getIntegerValuesOf(objID);
    String[] objOrientation = getIntegerValuesOf(orientation);
      String aX = String.valueOf(X);
      String aY = String.valueOf(Y);
      String iD = String.valueOf(objectID);
      String objO = String.valueOf(objOrientation);
    int absX = Integer.valueOf(aX).intValue();
    int absY = Integer.valueOf(aY).intValue();
    int obJOrientation = Integer.valueOf(objO).intValue();
    int obJID = Integer.valueOf(iD).intValue();
    I am fully aware that a string literal "1" is equal to 49 or something in terms of integers. But, if I assinged the value of the string to whatever an integer 1 is, then when I bring it back to an integer it sould remain a 1 correct?

  2. #2
    Join Date
    May 2006
    Location
    UK
    Posts
    4,473

    Re: Conversions

    I am fully aware that a string literal "1" is equal to 49 or something in terms of integers.
    The string literal '1' as an ASCII character has the decimal value of 49 but if you convert '1' to an int using Integer.valueOf(aX).intValue() or Integer.parseInt(aX) you get the int value of 1.

    But, if I assinged the value of the string to whatever an integer 1 is, then when I bring it back to an integer it sould remain a 1 correct?
    I don't know what you mean by this.
    Posting code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center