Skip to content

Commit

Permalink
cjson.ParseString demo
Browse files Browse the repository at this point in the history
  • Loading branch information
xushiwei committed Jul 26, 2024
1 parent ae50511 commit e027872
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions c/cjson/_demo/mkjson/mkjson.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ func main() {
mod.SetItem(c.Str("items"), syms)

cstr := mod.CStr()
str := c.GoString(cstr)
c.Printf(c.Str("%s\n"), cstr)
cjson.FreeCStr(cstr)

mod.Delete()

cjsonLoad(str)
}

func cjsonLoad(str string) {
mod := cjson.ParseString(str)

cstr := mod.Print()
c.Printf(c.Str("%s\n"), cstr)
cjson.FreeCStr(cstr)

Expand Down

0 comments on commit e027872

Please sign in to comment.