Simple C++ Help: I can't use a string as a parameter on an another class. (I'm a beginner) : I created a simple function in my cpp that prints out a text. Here's the code:

    #include "Sally.h"
    #include <iostream>
    using namespace std;
    
    Sally::Sally()
    {
    
    }
    
    void Sally::tell(string t){
    
        cout << t << endl;
    
    }

and here's how I prototype it on my .h file:

    #include "Sally.h"
    #include <iostream>
    using namespace std;
    
    Sally::Sally()
    {
    
    }
    
    void Sally::tell(string t){
    
        cout << t << endl;
    
    }

It gives me an error whenever I build it. It doesnt have any problems at all if im using int as a parameter. So the problem is that I wish to use a string as a parameter. Thanks to those who'll share their idea. God bless you all.



