From: Nick Jennings <nkj@namodn.com>
To: linux-c-programming@vger.kernel.org
Subject: using 'int char' with #define's variables.
Date: Sun, 1 Sep 2002 15:35:29 -0700 [thread overview]
Message-ID: <20020901153529.A16903@namodn.com> (raw)
Hi All,
A function that has a prototype of:
char * strrchr( char * str, int ch );
It takes a character as an int in that second param.
I am having trouble using it with a #define's VAR.
---
#define DIRMARK "/"
...
char * filename = strrchr(path, DIRMARK);
fprintf(stderr, "debug: filename = %s\n", filename);
---
gcc complains:
warning: passing arg 2 of `strrchr' makes integer from pointer without a cast
It compiles, but doesn't seem to work right:
debug: filename = (null)
Any suggestions?
- Nick
next reply other threads:[~2002-09-01 22:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-01 22:35 Nick Jennings [this message]
2002-09-01 22:28 ` using 'int char' with #define's variables Adam Kropelin
2002-09-02 1:16 ` Stephen Satchell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020901153529.A16903@namodn.com \
--to=nkj@namodn.com \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).