Saturday, August 18, 2012

I was bored because I couldn't figure out this thing...

Building a (week) game engine using SDL, will probably convert it to OpenGL eventually, but until then, THIS:

 #include <iostream>  
   
 class Number  
 {  
 private:  
      float x;  
 public:  
      Number( float input)  
      {  
           x = input;  
      }  
 }  
   
 class OtherNumber : public Number  
 {  
 private:  
   
 public:  
      OtherNumber( float input )  
      {  
           x = 0;  
           x -= input;  
      }  
 }  
   
   
 int main()  
 {  
   
   
   
 }  

Now, I like to think of my self as pretty fluent in C++ syntax, but for the life of me I can't figure out what the heck I'm doing wrong. This isn't the code I'm actually working, but it has the same syntax problem as what I'm actually doing. I have a class that acts one way, then another one the is almost exactly the same, but it has a compleatly differnt constructor and a few extra functions attached to it. So, I was going just inharit off of it overloading the constructor, but it doesn't seem to be working... clearly I'm doing something wrong...


No comments:

Post a Comment