Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double getSales(string line)
- {
- string num;
- double sales;
- for(int index=0; index<=35; index++)
- {
- if(isdigit(line[index]) || (char)line[index]=='.') num+=(char)line[index];
- }
- sales=atof(num);
- return sales;
- }
- error:
- SWICompanySales.cpp: In function `double getSales(std::string)':
- SWICompanySales.cpp:120: error: cannot convert `std::string' to `const char*' for argument `1' to `double atof(const char*)'
- rhune[hw9]$ c++ SWICompanySales.cpp -o SWISCompany
- SWICompanySales.cpp: In function `double getSales(std::string)':
- SWICompanySales.cpp:121: error: cannot convert `std::string' to `const char*' for argument `1' to `double atof(const char*)'
Add Comment
Please, Sign In to add comment