What i'm trying to do is, ignore the first 14 digits of the variable w with a string, and use only the other 7, but i've been unsuccessful with my attempts. Could someone explain to me in detail how to fix this or just fix it for me. Here's my original code.

Code:
 #include <iostream>   
 #include <sstream>     
 #include <string>            

using namespace std;
int main() { 
    long double w, t, p;    
    cout << "Please enter the price."; 
    cout << endl;   
    cin>>p;   
    t = 0;   
    cout << "Please scan the the weight.";  
    cin >>w; 
    cout << endl;  
    cout << endl;
    t = w * p + t;
    cout << endl; 
    cout <<"Total:"<<t;
    cout << endl;
    int i = 1000; while (i-- > 0) { cin >> w; t += w * p; cout << endl; cout<<"Total:"<<t; cout << endl; };
    cin.get();
    cin.get();
}
Here's my attempt at fixing it which returned the error:

21 no match for 'operator*' in 'str2 * p'
25 no match for 'operator*' in 'str2 * p'

Code:
 #include <iostream>   /* Declaration */
 #include <sstream>     
 #include <string>            

using namespace std;
int main() { 
    long double t, p;    /* Variables */
    string str2, w;
    cout << "Please enter the price."; /* output */
    cout << endl;   /* next line */
    cin>>p;   /* sets input as p */
    t = 0;   /* sets t as 0 */
    cout << "Please scan the the weight.";  /* output */
    cin >>w; /* input as w */
    cout << endl;  /* next line */
    cout << endl;
    
    string str= w; 
    str2 = str.substr (14,7);

    t = str2 * p + t;
    cout << endl; 
    cout <<"Total:"<<t;
    cout << endl;
    int i = 1000; while (i-- > 0) { cin >> w; t += str2 * p; cout << endl; cout<<"Total:"<<t; cout << endl; };
    cin.get();
    cin.get();
}