Answer the question
In order to leave comments, you need to log in
Is it possible to declare an int array using shared_ptr?
Does it make sense to declare an int array with a shared_ptr?
And if yes, then how to do it? And how to access such an array? shared_ptr<int> sh(new int[100]);
???
ps in general, there is a feeling that I'm not childishly stupid =)
Answer the question
In order to leave comments, you need to log in
Maybe std::array?
>>shared_ptr sh(new int[100]);
1. You say that you will store 1 int
2. You create 100 ints
3. And the result of step 2. you assign in item 1 though told that you will store one int
Cool?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question