Hi,
I am trying to figure out pointers. Whenever I run this, it prints my gcc version instead of the string I give it. Weird...
Walter
#include <strings.h>
#include <string.h>
#include <string>
#include <iostream>
char* toLOWER(char *input);
using namespace std;
main()
{
//string a("testing");
char *a = "TESTING";
cout << a << "\tThat was string a.\n";
cout << toLOWER(a) << "\tThat was the lowercase version of string a.\n";
return(0);
}
char* toLOWER(char *input)
{
char *lowerCASE = "";
for(int i = 0; i < strlen(input); i++)
{
lowerCASE += tolower(input[i]);
cout << input[i] << "\tThe character at:\t" << i << "\n";
cout << lowerCASE << "\tThat was lowerCASE:" << i << "\n";
}
return(lowerCASE);
}
