Search:

Type: Posts; User: Norm

Search: Search took 0.10 seconds.

  1. Thread: Arrays

    by Norm
    Replies
    12
    Views
    1,537

    Re: Arrays

    Now consider where the next empty slot is in the array you just defined. You can use the numElt variable to access it.
    Use it to add an element to that array and increment numElt after the element...
  2. Thread: Arrays

    by Norm
    Replies
    12
    Views
    1,537

    Re: Arrays

    Try writing a simple program that defines an array and an int variable: numElt. Add some elements to the array but don't fill it and set the value of numElt to the number of elements that were added...
  3. Thread: Arrays

    by Norm
    Replies
    12
    Views
    1,537

    Re: Arrays

    That is not very efficient to use a loop every time you want to know how many slots are used. Why not have the count of the number of used slots in a variable like: numElt?
  4. Thread: Arrays

    by Norm
    Replies
    12
    Views
    1,537

    Re: Arrays

    If the array has 100 slots and the code is only going to use some of them, how do you keep track of how many slots of the array have been used?
  5. Thread: Arrays

    by Norm
    Replies
    12
    Views
    1,537

    Re: Arrays

    numElt would be an int that has the count of the number of elements in the array that are being used. If the array had 100 elements and there were 5 elements in the array, numElt would be 5
  6. Thread: Arrays

    by Norm
    Replies
    12
    Views
    1,537

    Re: Arrays

    What part of the assignment are you having problems with?
Results 1 to 6 of 6