1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

bare: fix str[idx]

This commit is contained in:
Alexander Medvednikov
2019-11-16 23:22:40 +03:00
parent 0c5854e371
commit 5a1de13e10
3 changed files with 12 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
fn syscall5(number, arg1, arg2, arg3, arg4, arg5 voidptr) voidptr
fn write(fd int, data voidptr, nbytes u64) int {
fn write(fd int, data voidptr, nbytes int) int {
return syscall5(
1, // SYS_write
fd,
@@ -12,6 +12,9 @@ fn write(fd int, data voidptr, nbytes u64) int {
}
fn main() {
write(1, c'hallo\n', 6)
write(1, c'hello\n', 6)
s := 'test string'
write(1, s.str, s.len)
a := s[0]
}