linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* using 'int char' with #define's variables.
@ 2002-09-01 22:35 Nick Jennings
  2002-09-01 22:28 ` Adam Kropelin
  2002-09-02  1:16 ` Stephen Satchell
  0 siblings, 2 replies; 3+ messages in thread
From: Nick Jennings @ 2002-09-01 22:35 UTC (permalink / raw)
  To: linux-c-programming

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-09-02  1:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-01 22:35 using 'int char' with #define's variables Nick Jennings
2002-09-01 22:28 ` Adam Kropelin
2002-09-02  1:16 ` Stephen Satchell

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).