[Include] "stringh.inc": Implementing useful functions from C's "string.h"
#5

Your macros
pawn Код:
#define strncpy(%0,%1,%2,%3) \
                        strmid(%1,%1,0,((%2)-1)) \
                        strcat((%0[0] = '\0', %0),%1,%3)

#define strncat(%0,%1,%2,%3) \
                        strmid(%1,%1,0,((%2)-1)) \
                        strcat(%0,%1,%2)

#define strcasecmp(%0,%1,%2,%3) \
                        strtolower(%0) \
                        strtolower(%1) \
                        strcmp(%0,%1,%2,%3)

#define strncasecmp(%0,%1,%2,%3) \
                        strtolower(%0) \
                        strtolower(%0) \
                        strcmp(%0,%1,%2,%3)
won't work, since you have to put semicolons before you call the last functions.

Try
pawn Код:
#define strncpy(%0,%1,%2,%3)    strmid(%1,%1,0,((%2)-1));strcat((%0[0]='\0',%0),%1,%3)
#define strncat(%0,%1,%2,%3)    strmid(%1,%1,0,((%2)-1));strcat(%0,%1,%2)
#define strcasecmp(%0,%1,%2,%3) strtolower(%0);strtolower(%1);strcmp(%0,%1,%2,%3)
#define strncasecmp(%0,%1,%2,%3)    strtolower(%0);strtolower(%0);strcmp(%0,%1,%2,%3)
Reply


Messages In This Thread
"stringh.inc": Implementing useful functions from C's "string.h" - by Aeonosphere - 18.05.2013, 01:22
Re: "stringh.inc": Implementing useful functions from C's "string.h" - by RajatPawar - 18.05.2013, 04:37
Re: "stringh.inc": Implementing useful functions from C's "string.h" - by Niko_boy - 18.05.2013, 06:53
Re: "stringh.inc": Implementing useful functions from C's "string.h" - by Aeonosphere - 18.05.2013, 07:55
AW: "stringh.inc": Implementing useful functions from C's "string.h" - by BigETI - 18.05.2013, 08:01
Re: "stringh.inc": Implementing useful functions from C's "string.h" - by Emmet_ - 18.05.2013, 08:02
AW: Re: "stringh.inc": Implementing useful functions from C's "string.h" - by BigETI - 18.05.2013, 08:12
Re: AW: Re: "stringh.inc": Implementing useful functions from C's "string.h" - by Aeonosphere - 18.05.2013, 08:15
Re: AW: Re: "stringh.inc": Implementing useful functions from C's "string.h" - by Emmet_ - 18.05.2013, 08:17
Re: AW: Re: "stringh.inc": Implementing useful functions from C's "string.h" - by Aeonosphere - 18.05.2013, 08:23
Re: AW: Re: "stringh.inc": Implementing useful functions from C's "string.h" - by Emmet_ - 18.05.2013, 08:31
Re: "stringh.inc": Implementing useful functions from C's "string.h" - by Aeonosphere - 18.05.2013, 08:46
AW: "stringh.inc": Implementing useful functions from C's "string.h" - by BigETI - 18.05.2013, 10:04
Re: AW: "stringh.inc": Implementing useful functions from C's "string.h" - by Aeonosphere - 18.05.2013, 11:10
AW: "stringh.inc": Implementing useful functions from C's "string.h" - by BigETI - 18.05.2013, 14:50
AW: Re: "stringh.inc": Implementing useful functions from C's "string.h" - by BigETI - 18.05.2013, 20:06
AW: "stringh.inc": Implementing useful functions from C's "string.h" - by BigETI - 18.05.2013, 20:23
AW: "stringh.inc": Implementing useful functions from C's "string.h" - by BigETI - 18.05.2013, 20:43
AW: "stringh.inc": Implementing useful functions from C's "string.h" - by BigETI - 18.05.2013, 21:55
AW: "stringh.inc": Implementing useful functions from C's "string.h" - by BigETI - 18.05.2013, 22:35

Forum Jump:


Users browsing this thread: 2 Guest(s)