Pointer within a Struct

This is a discussion on Pointer within a Struct within the C Programming forums, part of the General Programming Boards category; I have a struct
Code:
typedef struct TEST {
int * Flag;
int Value;
} TEST;
TEST my_struct;
How do ...

What I'm ultimately doing here is writing a serial port driver... Here is the code I have... Please note that the bottom part of the code was provided for testing purposes... I've commented so you can see it...

Zero filling your buffer seems smarter than filling it with Xs, especially since you fill the entire thing, including the last space, and then use it like a string later on.

Also, no where in your code that I can find, is there anything that EVER sets your flag to anything other than zero. It's always zero. So it's always going to say it's timing out. Furthermore, if you have defined event states, and you're checking event states, why do you keep switching between using those flags and not using them?

Code:

if( e_flag == 0 )

You should be keeping consistent and always using:

Code:

if( e_flag == EVENT_INPROGRESS )

Or whatever your event is called. Half the time you just use a number, the other half you use your macro.

That combine with you using globals compared to locals, makes reading your code much more difficult.

I agree with your comments, however, the code you're talking about (main()) was provided by my instructor (in my project it is in a separate file) and cannot be changed. Only com_open, com_close, com_write and the interrupt functions were written by me and need to be fixed.

From what I can tell after doing some testing, the interrupts are not working. Any ideas?