Using define with variable values
- From: msigwald@xxxxxxxxx
- Date: 29 Apr 2005 21:23:41 -0700
The following line of code works, however, since my professor is a real
purist of c, I would like to know if this code is valid (is it good
code or a piece of crap?):
#define DMP_FILE argv[argc-1]
This would be use to do something like this:
void main(int argc,char *argv[])
{
FILE *p2file=fopen(DMP_FILE,"w");
}
Is this a macro? Cause in the examples of macro I've studied, variables
were involved in the macro itself. This would be like a regular define,
but with variable values.
.
- Follow-Ups:
- Re: Using define with variable values
- From: Eric Sosman
- Re: Using define with variable values
- From: Walter Roberson
- Re: Using define with variable values
- Prev by Date: Re: How to get file size?
- Next by Date: Re: Binary Arithmetics
- Previous by thread: Re: return a string
- Next by thread: Re: Using define with variable values
- Index(es):
Relevant Pages
|