so i find the period or whatever the sentence ends in. Then I create a substring from that and delete the part which contains the end character. Then i keep count of it.

Not sure why you want to delete anything, but counting lines by counting periods is one way to do it yes.
Keep in mind that periods are also used for other purposes like abbreviations and stuff like this >...

can someone check if this makes sense to find # of sentences. i think it does.

#include<iostream>

using namespace std;
int main()
{
string passage;
int space=0;
int sentence=0;
int word=0;
int character;
cout<<"enter the passage to find out readability index";
getline(cin,passage);
    for (int  i = 0; i < passage.length(); i++)
    {
        //number of words
        if (isspace(passage[i]) )
        {
            space++;
        }
        word=space+1;
        //number of sentences
        if(character=(passage.find('.')))
        {
            passage.substr(0,character);
            passage.erase(0,character+1);
            sentence++;
            cout<<"should print out multiple";
        }
        
    }
    cout<<"the sentence is"<<sentence;
    //cin.get();
    return 0;
}
if(character=(passage.find('.')))

I was just going through your code and found out this,

You are assigning a value to the variable character instead of checking.

it should actually be

if(character[b]==[b](passage.find('.')))
#include<iostream>

using namespace std;
int main()
{
string passage;
int space=0;
int sentence=0;
int word=0;
int character;
cout<<"enter the passage to find out readability index";
getline(cin,passage);
    for (int  i = 0; i < passage.length(); i++)
    {
        //number of words
        if (isspace(passage[i]) )
        {        
            space++;
        }
        word=space+1;
        //number of sentences
        if(character[i]==(passage.find('.')))
        {
            passage.erase(0,character+1);
            sentence++;
        }
        
    }
    cout<<"the sentence is"<<sentence;
    cin.get();
    return 0;
}

it still gives me error. invalid type int[int]

character is of type integer. and it is not an array .

I wish to know what you are trying to achieve in the following code
That way it would be easier to help..

if(character[i]==(passage.find('.')))
        {
            passage.erase(0,character+1);
            sentence++;
        }
if(character[i]==(passage.find('.')))
        {
            passage.erase(0,character+1);
            sentence++;
        }

Replace this with something like

if(issentence(passage[i])==true)
        {
            sentence++;
        }

After that write down a function

bool issentence(char);

Which returns true if the character is a '.' or ',' or '!' or '?'

I guess that's what you want right :)

This question has already been answered. Start a new discussion instead.