c++ - Constant array size in class -


I have a problem in creating an array in the constructor See my code:

  class Foo {private: const int size; Double * tab; Public: Foo (Int.); }; Foo :: foo (int s): size (s) {tab = new double [size] [size]; }  

The creator can not create a new array because the size of the array is not a constant value ... what is wrong in it? I'm sure it's really easy.

P.S. I apologize for my bad english.

tab indicator and assign you a different dimension in a loop separately Will happen.

  square foo {private: const int size; Double ** tab; Public: Foo (Int.); ~ Foo (); }; Foo :: foo (int s): size (s) {tab = new double * [size]; For (int i = 0; i  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -