Results 1 to 2 of 2
  1. #1
    ferfykins is offline Member
    Join Date
    Feb 2017
    Rep Power

    Default Not sure what this does...?

    int lastRow = 'A' + (numRows -1);

    Plz explain all parts of this.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Eastern Florida
    Rep Power

    Default Re: Not sure what this does...?

    It is an asssignment statement with an arithmetic expression that evaluates to an int value that is then assigned to the variable to the left of the =.
    The expression has the value of 'A' added to the value in numRows minus 1. char variables and literals are numeric values that can be used in arithmetic expressions.

    To see the value of 'A' print it cast to an int: (int)'A'
    If you don't understand my response, don't ignore it, ask a question.

Posting Permissions

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