Run ❯
Get your
own
website
❯
Run Code
Ctrl+Alt+R
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Change Language
Go to Spaces
Ctrl+Alt+P
#include
using namespace std; class Box { public: int size; explicit Box(int s) { size = s; } }; int main() { Box box1(5); // OK // Box box2 = 5; // Error, because the constructor is explicit cout << box1.size; return 0; }
5