Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to send array over network?

I'm using C++ and wondering if I can just send an entire int array over a network (using basic sockets) without doing anything. Or do I have to split the data up and send it one at a time?

like image 557
Dominic K Avatar asked Jul 24 '26 02:07

Dominic K


1 Answers

Yes.

An array will be laid out sequentially in memory so you are free to do this. Simply pass in the address of the first element and the amount of data and you'll send all data.

like image 196
Brian R. Bondy Avatar answered Jul 26 '26 17:07

Brian R. Bondy