Returning an Array in Managed C++

Posted on:April 02 2006

/// <summary> /// Returns list of children./// </summary> ISceneNode* GetChildren() []
That's how to return an array of pointers to ISceneNodes. Yes, that's right, there are square brackets at the end of the function declaration.





Comments:


WTF!!!
TSM
Quote
2006-04-02 20:24:00


one wonders who comes up with these things. In keeping with traditional form, anything after the function declaration should directly relate to the function (const is admittedly the only example that springs to mind). Logically, something relating to the return value should be at the beginning of the declaration where the return value type and any qualifiers are specified
Electron
Quote
2006-04-03 01:24:00


...if we are talking about Managed(!!) c++ why not use

array<System::IntPtr^>^ myArray = gcnew array<System::IntPtr^>(myArraySize);

and use it like:

myArray[1] = (System::IntPtr)device->getSceneManager()->addAnimatedMeshSceneNode(...);

or:

((irr::scene::ISceneNode*)myArray[1]->ToPointer())->setMaterialTexture(...);

It works ;-) !

...just waiting for a c++ guru's comments that *REAL* (loool) men do not use managed c++ - of course, *REAL* men are using a stone axe or a thingie called 'vi' ;-) !
Duncan Mac Leod
Quote
2006-04-03 12:18:00


real men do not use managed c++!!11!! :)
niko
Quote
2006-04-03 18:58:00


Well, I dunno about "real men", but men actually interested in speed are not using Managed C++. Platform wars are pointless (Windows has many benefits Linux does not & vice versa). But when you're talking byte-code compiled against machine-code compiled, speed is an issue.

And yes, I have code that proves that in processing requiring nested loops - machine-code compiled C++ is ~300% faster than .NET compiled code (exactly the same code too). Something to do with .NET being REALLY bad about stack management from what I can tell.

--EK
Eternl Knight
Quote
2006-04-04 03:25:00


Add comment:


Posted by:


Enter the missing letter in: "Interna?ional"


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons