Skip to content

Instantly share code, notes, and snippets.

@Sleepful
Created October 12, 2017 00:47
Show Gist options
  • Save Sleepful/ef185476ffd6e50332c54d9309c32fef to your computer and use it in GitHub Desktop.
Save Sleepful/ef185476ffd6e50332c54d9309c32fef to your computer and use it in GitHub Desktop.
/* Hello World program */
#include<stdio.h>
#include "structs.h"
main()
{
int a = 3;
printf("Hello World %d \n", a);
arqui* r;
r = initArqui();
a = getIR(r);
printf("Hello World %d \n", a);
}
#include <stdlib.h>
#include "structs.h"
typedef struct instructionRegister
{
int instr;
} iRegister;
typedef struct arqui_s
{
iRegister IR;
}
arqui;
arqui* initArqui()
{
arqui *s = malloc(sizeof(arqui));
iRegister r;
r.instr = 0;
s->IR = r;
return s;
}
int getIR(arqui* s)
{
int a = s->IR.instr;
return a;
}
typedef struct arqui_s arqui;
arqui* initArqui();
int getIR(arqui*);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment