Computing.Net > Forums > Programming > g++

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

g++

Reply to Message Icon

Name: belaidou
Date: October 10, 2002 at 01:09:49 Pacific
OS: unix
CPU/Ram: solaris 5
Comment:

Hello

Can you help me to understand this warning.


warning: cannot pass objects of non-POD type `class XXX' through `...'

thank you

mic




Sponsored Link
Ads by Google

Response Number 1
Name: cup
Date: October 10, 2002 at 03:42:35 Pacific
Reply:

POD refers to Plain Ol' Datatype. Basically, this is something like

struct
{
int code;
char* str;
} phonic[] =
{
{ 1, "alpha" },
{ 2, "beta" },
...
};

What you probably have is a class which you may be initializing in this way. With classes, it is preferable to initialize them using their constructors.

Phonic phonicLookup[] =
{
Phonic(1,"alpha"),
Phonic(2,"beta"),
...
};

At a guess, that is what it is moaning about but without seeing the actuall code, it is just a guess.


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: g++

GNU G++ Question www.computing.net/answers/programming/gnu-g-question/9375.html

g++ What the heck is it? www.computing.net/answers/programming/g-what-the-heck-is-it/6952.html

C++ programming in Linux using G++ www.computing.net/answers/programming/c-programming-in-linux-using-g/4470.html