The output will be:
**(ch+0)=A
**(ch+1)=B
**(ch+2)=C
**(ch+3)=D
**(*PtrToArrayOfPtr_s+0)=A
**(*PtrToArrayOfPtr_s+1)=B
**(*PtrToArrayOfPtr_s+2)=C
**(*PtrToArrayOfPtr_s+3)=D
So all these things are simple and clear enough there fore.
The problems starts when I am trying to initialize PtrToArrayOfPtr_s by the operator "new" to allocate mamory in dinamic part of mamory.
Thanks a lot, Lowest0ne!!! It is really so!!!!
keskiverto, when you declare variables in function's body, they are in stack and when you allocate memory to pointer with operator "new" this memory is in dinamic memory wich is much bigger then stack. So it is on your decision what memory you want to use......:-)
keskiverto, you should read some books about organisation memory in c++ programs. There are 3 types of memory: static, dynamic, stack. "ABCD" will be in static memory. About the question "Why to use such tricky types as in char *(*foo)[4]"-this is a forum of the beginners and if i write question here, then I am a beginner in c++ and I am learning now. And some learning exerсises are made for better understanding the ideology of pointers and are far from the real (at work) tasks.