What does this error mean??
cannot pass objects of non-POD type
I'm using G++
POD, in C++ stands for Plain Old Data.
While u have not posted the code you have, i cannot tell your excact error, but since it says something about objects passed on and POD, i assume u are using some old data type from C, and trying to do some sort of operation that only objects in C++ can handle..
Artificial Intelligence and Robotics egnineer
http://fox.zsuatt.com/
Can you post your code?
i also got the same warning i will give u the code
#include<iostream>
#include<string>
using namespace std;
class CEmployee {
public:
CEmployee(string name = "No Name",
string id = "000-00-0000",
double salary = 0)
: _name(name), _id(id)
{
_salary = salary;
}
string getName() const {return _name;}
void setName(string name) {_name = name;}
string getid() const {return _id;}
void setid(string id) {_id = id;}
double getSalary() const {return _salary;}
void setSalary(double salary) {_salary = salary;}
void promote(double salary) const {_salary = salary;}
private:
string _name;
string _id;
mutable double _salary;
};
int
main()
{
CEmployee employee("Naren", "001-338-423", 23456) ;
fprintf(stderr, "--Name() Id(%s) Salary(%f)-------\n", employee.getid(), employee.getSalary()) ;
}
:!g++ %
mutable.cc: In function `int main()':
mutable.cc:34: warning: cannot pass objects of non-POD type `struct std::string' through `...'; call will abort at runtime
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks