jeudi 26 septembre 2019

How to make buffer size dynamically in C++?

I receive string_value with random size every time less than 10000 size and I want to make data buffer size dynamically in C++. Currently using array.

char buffer[10000];
memset(buffer,0,10000);

and using strncpy() function.

strncpy(buffer, string_value, 10000);

Aucun commentaire:

Enregistrer un commentaire