delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/26/19:17:12

From: ovek AT arcticnet DOT no (Ove Kaaven)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Some comments and questions
Date: Sun, 26 Oct 1997 03:07:04 GMT
Organization: Vplan Programvare AS
Lines: 23
Message-ID: <62vei4$sm7$2@troll.powertech.no>
References: <199710220553 DOT SAA21269 AT atlantis DOT actrix DOT gen DOT nz> <62ovu9$d9v$1 AT news DOT ox DOT ac DOT uk>
NNTP-Posting-Host: alwayscold.darkness.arcticnet.no
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

mert0407 AT sable DOT ox DOT ac DOT uk (George Foot) wrote:

>#include <stdio.h>

>#define psize(a,b) printf ("Size of %s: %d\n",a,sizeof(b));

To respect the compulsory laziness of new programmers, make this macro
take only one parameter, like this:

#define psize(a) printf("Size of %s %d\n",#a,a);

int main(void) {
 psize(char);
 psize(short);
 ...

(I use such preprocessor tricks often when macro-fying common inline
assembler constructs... but it often requires some will to RTFM...
(which, btw, means Read The Forgotten Manual according to Usenet
documents I've "RTFM-ed"... the other meaning of the F is probably
common slang, which I do not prefer to use))


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019