Pointers and Strings C++

前端 未结 9 1161
栀梦
栀梦 2020-12-24 15:31

I\'m teaching myself C++ and I\'m a bit confused about pointers (specifically in the following source code). But first, I proceed with showing you what I know (and then cont

9条回答
  •  独厮守ぢ
    2020-12-24 15:56

    I think what you are doing, and others please correct me if I'm wrong, is that you're copying your string into a dynamic char array. So no you are not copying it into a pointer. The reason a pointer is involved there is because dynamic arrays require pointers to allocate their memory correctly if I am right.

提交回复
热议问题