How does one reset an array, to make it retain its size but get rid of all data it has stored?
Would one do it by setting all the array values to '\0'?

Recommended Answers

All 3 Replies

use the memset function.

Thanks again, Wolfpack. Should I set the character to '\0' to make an empty array, though?

if its a character array then initialize it with '\0' and if its an integer array then initilize it with 0

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.