Page 1 of 1

How to do this?

Posted: Tue Mar 23, 2010 6:20 pm
by evstevemd
I have tried options but I get closer but not as I want. I wonder if I'm missing something. Please bear with me if my style is unacceptable ;)

Code: Select all

class TestClass : public wxFrame{
        public:
                void myMethod(int x, bool y){
                        if(!y){
                                sqrt(x);
                         }
                         else{
                                 pow(x, 3);
                         }
                 }

}
I have problem, among some of them is if else issue and braces

Code: Select all

if(!y){
          sqrt(x);
          } else{
                   pow(x, 3);
}