1st time posting. This is not homework first of all. I am 38, hurt from a car wreck and haven't worked in several years, been in the hardware business for several years and I am learning c++ on my own to try to pick up some new job skills. With that out of the way I must say I am using a horrible book to learn c++ and the example code for using pointer arithmetic was left overlooked and the same code for pointer indexing was used twice. I think I was able to figure out the code but wanted it verified. I used a for loop and added the loop control value to index [0] to check each element for case. I believe a while loop could be better and will rewrite the code with that as well but I think the code I have now does the pointer arithmetic.
// reverse case using pointer arithmetic
#include <iostream>
#include <cctype>
using namespace std;
int main()
{
int i;
char *p;
char str[80] = "This Is A Test";
cout << "Original string: " << str << "\n";
You should use curly braces in your control statements. I know they aren't needed in this situation, but they would make the code much easier to read. Also, try to use fewer blank lines; that would also make it easier to read.
EDIT: Sorry, I meant curly braces, not parenthesis.