Lab : Reverse a character array and a Vector

Write a program that declares an array of characters and reverses them. Use this main program to begin with

  1. The function strlen can be used to find the length
  2. The standard "swap" code to reverse
  3. If your loop reverses from 0 to n, your will reverse and reverse back. So, only reverse half way
  4. Solution is given, try to code it without looking at it.

  • Solution

    Now, re-write the code to use vectors instead of arrays. Use push_back to put the numbers from 0 to n and let the user enter n. Use the at method instead of array notation.