could someone please point me to a link on how to convert my char* temp = new char[3]; to a char test[3]?

Recommended Answers

All 2 Replies

Lol. Firstly there is an issue. You donot know the size of the char* and therefore i dont think that you might consider creating a char without a particular size defined.

And by the way if you know the size of the array of the char* wouldn't it be a simple copy from the pointer to the char array?

could someone please point me to a link on how to convert my char* temp = new char[3]; to a char test[3]?

Post code. Generally we would not allocate just 3 characters because it isn't worth the effort. But, like everything else, there are exceptions.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.