a little bit offtopic: c++ question in kdevelop-tutorial

AndiX33 at aol.com AndiX33 at aol.com
Thu Feb 24 21:08:47 GMT 2000


hello, 

while reading the tutorials shipped with kdevekop, i´ve read an example i 
don´t understand. and i hope that within this list there are people skilled 
an experienced in programming.

the example:

 .....
1       class Math:
2       {
3       public:
4       //Constructor contains definition of PI
5       Math ():  PI (3,142) {}
6       ~Math () {}
7       float  diameter (float radius)
8       {
9       return ( radius * PI )
10      }
11      private:
12      // declare PI. we cann´t assign a value
13      const float PI
14      }

what does the ":" in line 4?? is it a kind of operator or what does it
it seems strange to me and i didn´t find a solution in books.
why you don´t write:

Math::Math ()
{
   pi=3,142;
}
 
greetings 
andreas schmitzer
    




More information about the KDevelop mailing list