LogiQuest
Back to Objects and Classes
6

What will be the output of the program?

#include <iostream>
using namespace std;
class S {
public:
    int a;
    S() : a(0) {}
};
int main() {
    S arr[3];
    cout << arr[0].a + arr[2].a << endl;
    return 0;
}
Easy

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.