Buffer!

Jun 8, 2011 at 4:04pm

Hi,

What would be or is the best way to clear buffer for data entry?

Thanks
Jun 8, 2011 at 4:37pm
This thread doesn't really belong here, it should go in the Beginners section (you can move it).

The normal way is to use a function like memset:
1
2
3
4
5
6
7
#include <string.h>

int main()
{
        char* buffer = malloc(2048);
        memset(buffer, 0, 2048);
}


http://www.cplusplus.com/reference/clibrary/cstring/memset/
Topic archived. No new replies allowed.