I keep getting this error each time i compile and run : main.cpp:15:29: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
#include <iostream>
using namespace std;
int main()
{
    string paragraph;
    cin>>paragraph;
    int wordsCount;
    int pSize = paragraph.length();
    for (int i = 0; i<pSize ; i++)
    {
        if (paragraph[i] == " ") {
            wordsCount++;
        }
    }
    cout << pSize << endl;
    return 0;
}
 
    