Initialize already declared char array in C++ -


I want to use something like this:

  char theArray [] = New chamber [8]; TheArray = {1,2,3,4,5,6,7,8}; Instead of  

  char theArray [] = {1,2,3,4,5,6,7,8};  

Is any such thing possible?

C ++ 0x

  four * ch; Ch = new four [8] (1, 2, 3, 4, 5, 6, 7, 8};  

@ David Thornely: Then switch these lines and There is no problem, and seriously you are talking about the process of re-processing the char [8] in the same memory pool as the previous code, then you play with the allottee yourself. Is needed, something like:

  four * ch1 = new four [8] {'A', 'B', 'C', 'D', 'E', 'F' , 'G', 'i'}; four * ch2 = new (ch1) four [8] (1, 2, 3, 4, 5, 6, 7, 8};  

Need apic op Is unlikely.


Comments