cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Another very basic question regarding in
Another very basic question regarding int constructors
Jul 12, 2009 at 6:42pm UTC
cppuser
(79)
Hi all,
look at this :
1
2
int
a;
int
b =
int
();
consider this two lines are local variables.
Why have some crazy value, and b is initialized to 0 ?
I thought int a; will call the default constructor of int, which is int().
What am I missing ?
Thank you in advance
Jul 12, 2009 at 7:23pm UTC
guestgulkan
(2942)
Haven't we done this already? Here:
http://www.cplusplus.com/forum/beginner/12533/
Jul 12, 2009 at 7:34pm UTC
cppuser
(79)
Yes, of course, it seems that I misunderstood something.
I'm sorry for this post.
Best regards
Jul 12, 2009 at 9:52pm UTC
Bazzy
(6281)
The basic type constructor is called implicitly only for global variables
Topic archived. No new replies allowed.