Jump to content

[SOLVED] A problem about c++'s pointer array


photo

Recommended Posts

Posted

How to declare an array of pointer? I am a beginner in cpp programing, I try to declare a pointer array like c#'s grammar, but it doesn't work. Please tell me how to do that and how to create a variable array, thanks!

微信截图_20230612124053.png

Posted

Hi, lgdnpt!

You can do it like this:

Unigine::Vector<Unigine::JointWheelPtr> jointWheels;

You can find more information about Unigine::Vector API in the documentation, and since Unigine::Vector works similar to std::vector and you are beginner in C++, I would recommend you to learn more about C++ STL (Standard Template Library) Containers and Iterators. I'm sure It will be really useful to you!

Thanks!

Posted
3 hours ago, moody_pooch said:

Hi, lgdnpt!

You can do it like this:

Unigine::Vector<Unigine::JointWheelPtr> jointWheels;

You can find more information about Unigine::Vector API in the documentation, and since Unigine::Vector works similar to std::vector and you are beginner in C++, I would recommend you to learn more about C++ STL (Standard Template Library) Containers and Iterators. I'm sure It will be really useful to you!

Thanks!

Thanks!

  • silent changed the title to [SOLVED] A problem about c++'s pointer array
Posted
3 hours ago, moody_pooch said:

Hi, lgdnpt!

You can do it like this:

Unigine::Vector<Unigine::JointWheelPtr> jointWheels;

You can find more information about Unigine::Vector API in the documentation, and since Unigine::Vector works similar to std::vector and you are beginner in C++, I would recommend you to learn more about C++ STL (Standard Template Library) Containers and Iterators. I'm sure It will be really useful to you!

Thanks!

Oh, I found my other mistake, I didn't use namespace when I declare the JointWheelPtr, thanks again, very, very thank you!

×
×
  • Create New...