mkitti / StaticStrings.jl

Fixed-length strings in Julia represented by NTuples
MIT License
13 stars 2 forks source link

Update documentation variable in order to make the example run #6

Closed musm closed 2 years ago

musm commented 2 years ago

Make the example runnable since the next line refers to the cs variable which is not defined.

musm commented 2 years ago

Oddly enough, I'm not sure why

julia> ccall(:printf, Cint, (Ptr{Cchar},), cs)
Hello world!12

doesn't add the newline after "Hello world!", maybe it's a windows thing?

mkitti commented 2 years ago

I probably cheated and added a \n. That is

julia> cs = CStatic"Hello world!\n"
CStatic"Hello world!\n"13

julia> ccall(:jl_printf, Cint, (Ptr{Nothing}, Ptr{Cchar},), stdout, cs)
Hello world!
13