Gast
#4646749
Hallo,
ich dachte eigentlich das folgende Funktioniert:
test.h:
#define TEST 5
extern uint8_t array[];
======================
test.c:
array[0] = TEST;
array[1] = 9;
======================
nutzen.h
void fuk(void);
======================
nutzen.c
#include "test.h"
#include "nutzen.h"
void fuk(void){
if(array[0] == 5)
usw...
}
======================
main.c
#include "test.h"
#include "nutzen.h"
int main(void) {
fuk();
return 0;
}
Tuts aber nicht. Wo ist mein Fehler? Ich will im Grunde das Array sowohl
in der test.c, der nutzen.c und main.c verändern/ausgeben können.
Ich bekomme folgende Meldungen:
test.c warning: data definition has no type or storage class
test.c warning: type defaults to 'int' in declaration of 'array'
[-Wimplicit-int]|
test.c conflicting types for 'array'
test.h note: previous declaration of 'array' was here
test.h error: invalid initializer