Sep 12, 2013 at 2:48am UTC
#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);
}
Sep 12, 2013 at 4:50am UTC
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.
Sep 14, 2013 at 12:12am UTC
#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);
}
Sep 14, 2013 at 12:14am UTC
This is what can i get from the change from array to pointer. the program doesn't capitalize letter the whole letters