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
1
Log In
Sign Up
quiz copy constructor
Anonymous
2,104 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
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 77
By
Unnamed contributor
2,035
0
0
quiz 72
By
Unnamed contributor
2,033
0
0
Python program(for beginners)
By
debapriya_dutta
11.4K
154
0
Exercice Javascript
By
StevenHanse
12.6K
178
0
ABOUT US
CAREERS
PRIVACY
FAQ
CodinGame - Work
The #1 tech hiring platform
SCREENING
INTERVIEWING
ABOUT US
CAREERS
PRIVACY
FAQ
Facebook
YouTube
Twitter
LinkedIn
FR
EN