Q:

initializtion class object error using ternary operator

I'm trying to create an object using the ternary operator, But every time, its called only the first one. Here is my simple code:
bool itTrue(int x, int y){
  if(x>y)
     return true;
  return false;
}
class myClass {
    public:
       myClass(int x){
          val=x;
      }
       myClass(int x, int y){
          val=x*y;
      }
      val=0;
 };
int main(){
   aa=5;
   bb=6;
   myClass cc = isTrue(aa,bb) ? (aa,bb) : (bb,bb);
   cout<<cc.val<<endl;
   return 0;
}

Some how, using the Debuger, after isTrue functions is called, the constructor who gets called is the one using one object:
myClass(int x)
 But I want to use both arguments, How do I call the other one:
myClass(int x, int y) using the ternary operator? 

A:

Before you try and answer the whole of your own question, we should look at what happens when we simplify it to not include the ternary operator:
myClass cc = (aa, bb);

This would also call the single-parameter constructor, because this is not how you pass parameters to a constructor, it is not the same as
myClass cc(aa, bb);

Instead, what you are doing is invoking the "comma operator". You should take a look at what value is being passed to your single value constructor, you'll find that it is the value of bb.
#include <iostream>

class A {
public:
    A(int a) {
        std::cout << "single " << a << '\n';
    }
    A(int a, int b) {
        std::cout << "double " << a << ',' << b << '\n';
    }
};

int main()
{
    int aa = 5;
    int bb = 6;

    A a = (aa, bb);
}

http://ideone.com/wapbv9
The comma operator evaluates the expression on the left, discards it and evaluates the expression on the right. So what you are actually writing is:
(void)aa;  // a way to say "evaluate this and ignore it"
A a = bb;

In order to do what you are trying to achieve you'll need to construct an instance of your class:
myClass cc = isTrue(aa, bb) ? myClass(aa, bb) : myClass(bb, bb);

