Sign in to follow this  

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

This topic is 4283 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
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
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

This topic is 4283 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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