jweinst1
9/2/2016 - 5:16 PM

some practice with void pointer arrays in c

some practice with void pointer arrays in c

#include "stdio.h"

int main(void) {
    // Disable stdout buffering
    setvbuf(stdout, NULL, _IONBF, 0);
    
    void * items[2];
    int a = 6;
    int * b = &a;
    char word[] = "hello";
    items[0] = b;
    items[1] = word;
    char * w = items[1];
    printf("%s\n", w);
    //hello
    return 0;
}