Code:
#include<string>#include<iostream>
using namespace std;
void computeFeatures(string);
int main()
{
string text = "Cpp is fun";
computeFeatures( text );
text += " for everyone";
computeFeatures(text );
text = "cpp fun";
computeFeatures( text );
text.clear();
computeFeatures( text );
return 0;
}
void computeFeature(string text)
{
cout << endl << "String : " << text << endl;
cout << "Size: " << text.size();
cout << " Capacity: " << text.capacity();
cout << "Empty?: " << text.empty() << endl;
}
Code:
/usr/bin/ld: /tmp/ccYzGeKL.o: in function `main':main.cpp:(.text+0x66): undefined reference to `computeFeatures(std::__cxx11::basic_string