So define it in a header and include as required...
constants.h (terrible name )
Code:
#ifndef INCLUDED_CONSTANTS_H
#define INCLUDED_CONSTANTS_H
/* probably best to include the +1 here... */
#define MAXTOKENLEN 32
#endif /* INCLUDED_CONSTANTS_H */
header.h
Code:
#ifndef INCLUDED_HEADER_H
#define INCLUDED_HEADER_H
#include "constants.h"
extern char tokenString[MAXTOKENLEN];
#endif /* INCLUDED_HEADER_H */
main.c
Code:
#include <stdio.h>
#include "constants.h"
#include "header.h"
/* ... */
char tokenString[MAXTOKENLEN];
int main(void)
{
/* ... */
return 0;
}
Of course there is nothing stoping you from defining MAXTOKENLEN and extern char tokenString[] in the same header.