simple 2d array

Simple cross array of sizes

Blog tags: 

I recently coded this in less than 30 seconds for a student showing how you can create a simple 2D array to return sizes of structs to be used inside of buffer array function. This should be explanatory by itself... the use - its up to you.

#include <stdlib.h>
#include <stdio.h>
#include <string.h>

typedef struct type1_s {
    int data;
}type1_t;

typedef struct type2_s {
    int data;
    int data2;
}type2_t;

Subscribe to RSS - simple 2d array