The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Newsgroups: comp.lang.c
From: f...@genesis.demon.co.uk (Lawrence Kirby)
Date: Fri, 19 Oct 2001 12:44:14 GMT
Local: Fri 19 Oct 2001 13:44
Subject: Re: __FUNCTION__ ????
In article <47295485.0110190255.7f389...@posting.google.com>
sob...@eudoramail.com "Sobhan Vezzu" writes: >Hello All, The C language doesn't define anything called __FUNCTION__ although it does > I understood that __FUNCTION__ is a preprocessor macro, which define __FILE__ and __LINE__ > 1) I have written a small code, only for __FUNCTION__ it Perhaps because it isn't defined? >prints as unknown why? >What is the difference between __FILE__ and You compiler may provide __FUNCTION__ as an extension. Most likely it >__FUNCTION__. When I comment #ifndef __FUNCTION block it prints the >file name. will expand to the name of the function containing it. If it isn't in a function then it won't be able to expand to anything. The new C standard C99 does introduce something like this but it is called __func__ and it is *not* a macro, it acts like the name of a static variable within that function. > 2) Where do I get a list of all the preprocessor macros. Any good tutorial book on C should give one. >#include <stdio.h> There is a standard defined macro named assert(), this is an unwise name >#include <errno.h> >#ifndef __LINE__ >#ifndef __FILE__ >#ifndef __FUNCTION__ >int assert(int bool, int line, char *file, char *fun) to define in your code. -- You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||