Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!aplcen!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!mips!ultra!ted From: ted@ultra.com (Ted Schroeder) Newsgroups: comp.lang.c Subject: character strings, macros, ANSI c, multicharacter chars question Keywords: string, multicharacter, ebcdic/ascii Message-ID: <1990Jan4.190431.19748@ultra.com> Date: 4 Jan 90 19:04:31 GMT Distribution: na Organization: Ultra Network Technologies Lines: 30 I have a macro that needs to turn an argument into a character string. I notice in IBM/370 C there is a # operator that will do just this. Is this proper ANSI C? Here's an example: #define PRINTS(a) printf("%s\n", #a); Also, I would like to create an integer that is full of '+' characters i.e. on an ASCII machine the four byte integer would be 0x2b2b2b2b. Unfortunately the code must run on both ASCII and EBCDIC machines. Right now I do the following #ifdef ASCII #define PLUS 0x2b2b2b2b #else /* EBCDIC */ #define PLUS 0x4e4e4e4e #endif /* ASCII */ Is there any portable way to do this? Thanks in advance for your help. Ted Schroeder ted@Ultra.com Ultra Network Technologies ...!ames!ultra!ted 101 Daggett Drive San Jose, CA 95134 408-922-0100 Disclaimer: I don't even believe what I say, why should my company?