How to cast a "int" to "uchar&" for using SocketSend() function?


I need to send an int via socket, but the casts I'm using doesn't works. How to do it in MQL?

I'm trying it like this.

  int buffer;
  SocketSend(socket, (uchar*)&buffer, sizeof(int));

Thank you so much!!


i did it like this.

#import "msvcrt.dll"
  int memcpy(char &dst[], int &src, int cnt);

int src=5;            
char dst[sizeof(int)]; 
memcpy(dst, src, sizeof(int));       
SocketSend(dst, sizeof(int));

i hope it help to someone too!!