Skip to content

Table definitions shoud be in data_structures.h instead of data_structures.c #5

@dassaf1

Description

@dassaf1

Table definitions should be in data_structures.h instead of data_structures.c, otherwise other C files who include data_structures.h as it is today wont be able to access struct fields:

#include "data_structures.h"

int main() {
    printf("%s", opcodes_table[0].opcode);
    return 0;
}
/home/dafna/mmn/mmn14/c-assembler/main.c:4: undefined reference to `opcodes_table'

image

Reference:
https://stackoverflow.com/questions/6316987/should-struct-definitions-go-in-h-or-c-file

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions