win10, nim0.14.2 
    
    
    # use alloc0
    var inputs = cast[array[10,int]](alloc0(sizeof(int) * 10))
    inputs[0] = 1
    inputs[1] = 2
    inputs[2] = 3
    for i in 0..9:
      echo inputs[i]
    echo repr inputs
    
    var test = alloc0(10)
    zeroMem(test, 10)
    echo repr cast[array[10,char]](test)
    
    
    
    1
    2
    3
    6553000
    0
    6552640
    6553000
    1
    7607136
    1
    [1, 2, 3, 6553000, 0, 6552640, 6553000, 1, 7607136, 1]
    
    ['P', '@', '\25', '\0', '\0', '\0', '\0', '\0', '\9', '\0']
    

Maybe I use the incorrect way?

Reply via email to