need help to change from array to pointer arithmetic

#include <iostream>
#include <string>

using namespace std;

int main() {
char aString[] = "hello world";

cout << "aString = " << aString << endl;

for (int i = 0; aString[i] != '\0'; i++) {
if (aString[i] == ' '){
continue;
}

aString[i] = aString[i] - ' ';
}

cout << "aString = " << aString << endl;

return(0);
}
What kind of help do you need? Maybe I missed the question. Perhaps instead of waiting for someone to do your homework for you, show us what you have so far in the rewrite, and then we'll see where you need some help.
#include <iostream>
#include <string>

using namespace std;

int main() {
char aString[] = "hello world";
char *prt;
prt = aString;

cout << "aString = " << prt << endl;

for (int *prt = 0; *prt != '\0'; *prt++) {
if (*prt == ' '){
continue;
}

prt = prt- ' ';
}

cout << "aString = " << aString << endl;

return(0);
}
This is what can i get from the change from array to pointer. the program doesn't capitalize letter the whole letters
Topic archived. No new replies allowed.