Quick actions

cmd+k|ctrl+k

Navigation

Languages

Bounded Malloc Array

Snippet info

Language

Cpp

Visibility

public

Author

evine

Created

2016-06-09T13:21:27Z

Updated

2016-06-09T13:55:52Z

#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <assert.h>

#define CONCAT_(a,b) a##b
#define CONCAT(a,b) CONCAT_(a,b)

#define VAR_TYPE float
#define VAR_NAME f32
#include "bound_array.cpp"

#define VAR_TYPE int64_t
#define VAR_NAME s64
#include "bound_array.cpp"

int main()
{
    Array_f32 eple = Array_f32_init(32);
    eple[31] = 91;
    printf("eple.size = %lu\neple[31] = %f\n", eple.size, eple[31]);
    
    
    Array_s64 pera = Array_s64_init(54);
    pera[24] = 3771;
    printf("pera.size = %lu\npera[24] = %li\n", pera.size, pera[24]);
    
    return 0;
}
INFO