C
chessc4c6
As part of a programming assignment, I am supposed to create a my own
toUpper and toLower class functions, This is my piece of code:
void Mystring::toUpper(char *s1){
char *cpy = theString = new char[strlen(s1)+1];
char lower = 'a';
char higher = 'A';
while(!s1++){
if(s1==lower)
s1=higher;
lower++
higher++;
}
}
and this is my returnString function:
char* Mystring::returnString(){
return theString ;
}
But when I return the string, I just get gibberish on the screen...can
someone please help me out and just guide me in the right direction
toUpper and toLower class functions, This is my piece of code:
void Mystring::toUpper(char *s1){
char *cpy = theString = new char[strlen(s1)+1];
char lower = 'a';
char higher = 'A';
while(!s1++){
if(s1==lower)
s1=higher;
lower++
higher++;
}
}
and this is my returnString function:
char* Mystring::returnString(){
return theString ;
}
But when I return the string, I just get gibberish on the screen...can
someone please help me out and just guide me in the right direction