Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/31/02 19:56
Read: times


 
#31788 - RE: KEIL: How to send a table to a function
"I'm using Keil, but I think my issue is more a C langage issue."

Yes, I think so

*** file1.h ***.
xdata variable[]={0x01, 0x02, ....}; //128 values
You haven't specified the type of this variable - therefore 'C' will assume int

You shouldn't put the variable definition in a header (.h) file; only declarations should go in headers!

I've covered this before - do a 'Seach' for "declaration" AND "definition"

"even if I change the 'variable' values, the compiler always uses old values for which I don't know how it has kept it!"

Not quite sure what you mean by this?

Do you really mean that you have a compile-time problem, or is it a run-time problem?
Or both??

At run-time, it's probably because of the definition in your header - this mean that each file contains a separate definition of 'variable' - so changes to one would not affect the other!

Presumably, you actually wanted just one definition, with the other file making an external reference?
void Display (U8 *variable)
You defined 'variable' as an int (presumably by accident) - so this is not going to give correct results!

List of 11 messages in thread
TopicAuthorDate
KEIL: How to send a table to a function            01/01/70 00:00      
RE: KEIL: How to send a table to a function            01/01/70 00:00      
RE: KEIL: How to send a table to a function            01/01/70 00:00      
RE: KEIL: How to send a table to a function            01/01/70 00:00      
RE: KEIL: How to send a table to a function            01/01/70 00:00      
RE: KEIL: How to send a table to a function            01/01/70 00:00      
RE: KEIL: How to send a table to a function            01/01/70 00:00      
RE: KEIL: How to send a table to a function            01/01/70 00:00      
RE: KEIL: How to send a table - James            01/01/70 00:00      
RE: KEIL: A-men Andy            01/01/70 00:00      
RE: KEIL: global variables            01/01/70 00:00      

Back to Subject List