Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

class member initializer question #2 ---- C++

Status
Not open for further replies.

Lucifre

Full Member level 2
Full Member level 2
Joined
Jul 5, 2005
Messages
125
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,296
Location
Detroit MI
Activity points
2,389
hi!
If anyone ever experienced this problem?
When i have a class that uses a constructor with member initializers, i cannot create a class array with more objects than 0 of that type? why?
 

C++ only allows arrays of class objects having default contructors.
One solution is to remove your initializers from the constructor so you have a default constructor and then assign your initial values in the constructor body. This is not the preferred way to initialize an object, but works.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top