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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/04/02 08:50
Read: times


 
#31962 - RE: KEIL: How to send a table to a function
<html>
if you want to have your definition and declaration in the header file, on the same line, you can use:<code>
// display.h
#ifdef DISPLAY_C
#define EXTERN
#define INIT(A) = (A)
#else
#define EXTERN extern
#define INIT(A)
#endif
EXTERN U8 picture[8];
EXTERN U8 once INIT(0);

// display.c
#define DISPLAY_C
#include "display.h"
</code>
maybe you can use the INIT macro to initialize an array (like "INIT({0, 0}"). but i don't have a compiler at hand to test it, so i just showed it with a scalar ("once").

if INIT doesn't work with arrays, you can have an ifdef in the header, with the declaration in one section of the ifdef and the definition in the other section. at least they are still closer together than if you put them in different files (and easier to check).

<table><tr><td>
james
</td><td>

www.jameshinnant.com
</td></tr></table>
</html>


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