Search:

Type: Posts; User: tabstop

Search: Search took 0.14 seconds.

  1. Thread: Merging Arrays

    by tabstop
    Replies
    15
    Views
    7,895

    int array1[size1],array2[size2],array3[size]; ...

    int array1[size1],array2[size2],array3[size];

    Not even a little bit. VLA are illegal in C++, and even if you're using g++'s extensions, you have to figure out what size1, size2, and size are...
  2. Thread: Merging Arrays

    by tabstop
    Replies
    15
    Views
    7,895

    '-' is the number 45 . Are you willing to give...

    '-' is the number 45 . Are you willing to give up the number 45 and use it instead as a "this spot is empty" marker? If so, then you're in.

    Assuming you're on an ASCII machine, naturally.
  3. Thread: Merging Arrays

    by tabstop
    Replies
    15
    Views
    7,895

    I said something about negative numbers, yes. ...

    I said something about negative numbers, yes. But I'll say it again, in italics this time: you cannot have empty spaces in an array. There will be a number in that place. If you want to think of...
  4. Thread: Merging Arrays

    by tabstop
    Replies
    15
    Views
    7,895

    Arrays can't have empty slots -- they will be...

    Arrays can't have empty slots -- they will be filled with something. If you expect the users to not type negative numbers, you can use a negative value as a sort of "hey this number shouldn't be...
Results 1 to 4 of 4