Jump to content
  • Advertisement
Sign in to follow this  
exorcist_bob

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

This topic is 4493 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

Advertisement
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
Finally! I figured it out! For your reference, you have to implement some kind of declaration like this:

array<DataType^>^Variable;

Thanks for all your help, r++!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!