mercredi 22 avril 2020

Can we use memset() function to fill an array of numbers(int or float)?

I have this code:

int a[10];
memset(a, 5, 9);
for(int i = 0; i < 5; i++) cout << a[i] << " ";

Will it print 5 5 5 5 5 ?

Aucun commentaire:

Enregistrer un commentaire