Consider a class named complexNumber. Which code will result in an equivalent object?

Advertisement

complexNumber(float real, float im)
: real_part(real),
im_part(im){}

  • A
    complexNumber(float real, float im) {
    this->real = real_part;
    this->im = im_part;
    }
  • B
    complexNumber(float real, float im) {
    this->real_part(real);
    this->im_part(im);
    }
  • C
    complexNumber(float real, float im) {
    this->real_part = real;
    this->im_part = im;
    }
  • D
    complexNumber(float real, float im) {
    this->real_part = ℜ
    this->im_part = &im;
    }
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Leave a Comment

Share via
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Send this to a friend