mirror of
https://github.com/goplus/llgo.git
synced 2025-09-27 03:56:05 +08:00
22 lines
315 B
Go
22 lines
315 B
Go
package main
|
|
|
|
import (
|
|
"github.com/goplus/lib/c"
|
|
)
|
|
|
|
func concat(args ...string) (ret string) {
|
|
for _, v := range args {
|
|
ret += v
|
|
}
|
|
return
|
|
}
|
|
|
|
func main() {
|
|
result := concat("Hello", " ", "World")
|
|
c.Fprintf(c.Stderr, c.Str("Hi, %s\n"), c.AllocaCStr(result))
|
|
}
|
|
|
|
/* Expected output (stderr):
|
|
Hi, Hello World
|
|
*/
|