Sign in to follow this  
exorcist_bob

[.net] can't create an array of managed objects

Recommended Posts

BradSnobar    232
I think the syntax might be wrong.
I'm not sure though since I haven't programmed in c++ for quite a while.
Try something like this:

System::Double[] Something = new System::Double[5];

Share this post


Link to post
Share on other sites
Krisc    494
What is the error message?

I believe you have to use a pointer. At least in C++ 1.1 I did.

System::Double * array[] = new Double[6];

Share this post


Link to post
Share on other sites
exorcist_bob    187
None of that is really helping me. Here is a more direct example:


ref class SavingsInterestRatesAndFees
{
public:
System::String^ Name;
System::Double InterestRate[];
System::Double PercentYieldRate[5];
System::Double MinimumOpeningDeposit;
System::Double MinimumMaintainedBalance;
System::Double MonthlyServiceFee;
System::Double MinimumRequiredToWaiveServiceFee;

SavingsInterestRatesAndFees();
};

SavingsInterestRatesAndFees::SavingsInterestRatesAndFees()
{
InterestRate = gcnew System::Double[5];
};



I keep getting this error:
DBEngine.h(114) : error C4368: cannot define 'InterestRate' as a member of managed 'SavingsInterestRatesAndFees': mixed types are not supported

Thanks for all your help,
exorcist_bob

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this