Non-Portable pointer assignment?

Daniel Tietze lion at dat1hb.north.de
Mon Jun 3 21:06:30 AEST 1991


roy%cybrspc at cs.umn.edu (Roy M. Silvernail) writes:

> foo(char *p) {
>     char *q;
> 
>     q = strchr(p,'x');  /* this line gets complaints */
> }
> 
Try q=strchr(p,"x"); , this should work. If I'm not mistaken, TC uses
'x' to denote a string and "x" to denote a char. At least, it always
works this way when I get that error message (and, being something of a
C novice, I get it rather more often than the average C programmer).
    Daniel


+------------------------------------------------------------------+
| Daniel Tietze, 2800 Bremen 1,  Tel.(voice) : 0421/448806         |
|-=============- DATELINE Communications, Bremen.  The home of DMS |
| Mail: (private) lion at dat1hb.north.de (univ) E07J at DHBRRZ41.BITNET |
|-====- DMS-Support: dateline at dat1hb.north.de                      |
+------------------------------------------------------------------+



More information about the Comp.lang.c mailing list