Preprocessor question

Ari Juhani Huttunen ahuttune at niksula.hut.fi
Sun Feb 17 09:05:48 AEST 1991


I would like to do the following or something similar:

#define BLOCK_SIZE 1024

char *message = "The block size is " # BLOCK_SIZE " bytes.";

I need the result: "The block size is 1024 bytes."

I know what I am doing wrong, but HOW should I do it? These alternatives
are no good:
	- #define BLOCK_SIZE_STRING "1024"
	- char *message = "The block size is 1024 bytes.";
--
___  ___  ___  ___  ___  ___  ___  ___  ___  ___  ___  ___  ___  ___  ___  ___
I I__I I__I I__I I__I I__I I__I I__I I__I I__I I__I I__I I__I I__I I__I I__I I_
Ari Huttunen      A computer is like a house of cards. Not as reliable,
                  but it has an equal number of incompatible parts.
_______________________________________________________________________________



More information about the Comp.std.c mailing list