The program is supposed to use a function that accepts a pointer to a C-string as an argument and capitalizes the first character of each sentence in the string. I'm having trouble with the output. This is my code:
#include "stdafx.h"
#include <cstring>
#include <iostream>
using namespace std;
void Capitalize(char *);
int _tmain(int argc, _TCHAR* argv[])
{
char sentence[1000];
cout << "Please enter a sentence: " << endl;
cin.getline(sentence, 1000);
char *sentencePtr = sentence;
Capitalize(sentencePtr);
cout << sentencePtr;
cin.get();
return 0;
}
void Capitalize(char *str){
int count;
for(count = 0; count < strlen(str); count++){
if(str[count] = '.'){
count += 2;
toupper(str[count]);
}
}
}