Closed Spoiledpay closed 2 years ago
@Spoiledpay
Yes, it's equivalent to ubyte
.
import basics
func main {
// -------------------------------------------
// Example 1
// -------------------------------------------
greeting 6 ubyte = {'H'ub, 'e'ub, 'l'ub, 'l'ub, 'o'ub, 0x00ub}
printf('%s\n', &greeting[0])
printf('%s\n', greeting at 0)
printf('%s\n', &greeting as *ubyte)
// -------------------------------------------
// Example 2
// -------------------------------------------
cstring *ubyte = 'Hi'
printf('%s\n', cstring)
// -------------------------------------------
// Example 3
// -------------------------------------------
heap_cstring *ubyte = strdup(cstring)
defer free(heap_cstring)
printf('%s\n', heap_cstring)
}
Hello
Hello
Hello
Hi
Hi
Hello! I didn't find the Char type in Adept's documentation. Does it exist in another form?
char greeting[6] = {'H', 'e', 'l', 'l', 'o', '\0'};