OT: c++ q

OT: c++ q

Erez D erez0001 at gmail.com
Sun Apr 26 15:38:53 IDT 2009


hi

i have encountered a problem with g++

i have a class a, with forward declaration of a function "do_something" and
a constructor a(int val);
i implement them in a cpp file.

g++ complains of redefinition of the constructor but not of the
do_something() function.

why ?

files:
== a.h ===
class a {
int m_a;
 a (int val);
 void do_somthing()
}

== a.cpp ===
#include "a.h"
a::do_somthing {a.m_a++;};
a::a(int val):m_a(val) {};

============


any idea ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20090426/97082af2/attachment-0001.html>


More information about the Linux-il mailing list