Hi All,
Ok here we go;
I have a global.h file with a extern char glb_holder[50];
+ global.c with char glb_holder[50];
now I have ;
(one.c)
then
(two.c)
but now when I try to use it again...
it would 3/5 times get corrupted/ mem re-allocated
Should I make holder a pointer? Its almost like this problem ..
<url removed see posting guidelines>
Also in my app I can't use ANY classes, so all my .c files have functions in them.
Really any feedback would be appreciated, plus if I left out some vital stuff feel free to ask me for it.
Thanks in advance
John
Ok here we go;
I have a global.h file with a extern char glb_holder[50];
+ global.c with char glb_holder[50];
now I have ;
(one.c)
Code:
global.h
void doWork (void) {
unsigned char data[30];
// data gets value
memcpy(glb_holder, data, 30);
}
(two.c)
Code:
global.h
void showWork (void) {
//shows or prints glb_holder and all is ok
}
it would 3/5 times get corrupted/ mem re-allocated
Should I make holder a pointer? Its almost like this problem ..
<url removed see posting guidelines>
Also in my app I can't use ANY classes, so all my .c files have functions in them.
Really any feedback would be appreciated, plus if I left out some vital stuff feel free to ask me for it.
Thanks in advance
John
Comment