Employers: discover CodinGame for tech hiring
EVENTS
UPCOMING
PAST
SOLO
PUZZLES
CODE GOLF
OPTIMIZATION
MULTI
LEADERBOARDS
CLASH OF CODE
BOT PROGRAMMING
CODING ESCAPE
COMMUNITY
CONTRIBUTIONS
LEARN
DISCORD
FORUM
LIVE STREAMS
BLOG
Log In
Sign Up
quiz copy constructor
Anonymous
2,255 views
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <iostream>
struct A
{
A() : val() {}
A(int v) : val(v) {}
A(A a) : val(a.val) {}
int val;
};
int main(int argc, char** argv)
{
A a1(5);
A a2(a1);
std::cout << a1.val + a2.val << std::endl;
return 0;
}
Run
0
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
Suggested playgrounds
Quiz 66
By
Unnamed contributor
2,871
1
0
Quiz 37
By
Unnamed contributor
2,287
1
0
Exercice Javascript
By
StevenHanse
19.4K
270
0
Sales Tax Calculator
By
DebatPay
834
8
0
ABOUT US
CAREERS
PRIVACY
FAQ
The #1 tech hiring platform
SCREENING
INTERVIEWING
ABOUT US
CAREERS
PRIVACY
FAQ
Facebook
YouTube
Twitter
LinkedIn
FR
EN