How to send integer with pipe between two processes!

前端 未结 4 1727
情深已故
情深已故 2021-02-05 12:12

I am trying to send an integer with pipe in a POSIX system but write() function is working for sending string or character data. Is there any way to send integer wi

4条回答
  •  名媛妹妹
    2021-02-05 12:36

    Aschelpler's answer is right, but if this is something that can grow later I recommend you use some kind of simple protocol library like Google's Protocol Buffers or just JSON or XML with some basic schema.

提交回复
热议问题