My C++ Quiz

The ultimate place to learn C++!

Question #49: What is the output of the program?

#include <iostream>

class Foo
{
public:

  char c;
  static double sd;
  double d;
  int i;
};

int main(int argc, char** argv) 
{ 
  Foo f = { 72, 3.14 };

  std::cout << f.c + f.d + f.i << std::endl;

  return 0; 
}