The following is the problem code.
#include
#include
using namespace std;
void convertToUppercase(char *);
int main()
{
cha
The condition of your while
loop is wrong, you need to write while(*sPtr != '\0')
with single quotes.
Explanation: '\0'
is a single character, "\0"
is a string constant, i. e. an array of two characters in this case.
There are also shorter ways to write your loop condition:
You can just use a plain zero instead of '\0'
: while(*sPtr != 0)
You can even omit the comparison since you are comparing to zero: while(*sPtr)