Is there anyway to create null terminated string
in Go?
What I'm currently trying is a:="golang\0"
but it is showing compilation error:
non-octal character in escape sequence: "
在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
--------------------------------
39
So
Or use hex code (2 hex digits):
Or a unicode sequence (4 hex digits):
Example:
Output: all end with a 0-code byte (try it on the Go Playground).
|
0
insted to get your work done. – ameyCU Jun 24 '16 at 7:03\x00
in strings. Also, the language doesn't provide NUL-terminated strings so.. yes, you are forced to modify every string. – toqueteos Jun 24 '16 at 8:05