V
vashwath
Hi all,
Below macro moves specified number of bytes from a specified index of
source
string to a specified index of destination string.
#define STRMOV(src_str,src_ind,length,dst_str,dst_ind)\
do\
{\
int s,d;\
s = src_ind;\
d = dst_ind;\
while(s < length && src_str != '\0')\
{\
dst_str[d] = src_str;\
d++;\
s++;\
}\
}while(0);
I have tested this for some inputs. Looks like this is performing the
intended functionality.
Please let me know if there are any corrections or any improvements to
be done to this macro.
Thanks
Below macro moves specified number of bytes from a specified index of
source
string to a specified index of destination string.
#define STRMOV(src_str,src_ind,length,dst_str,dst_ind)\
do\
{\
int s,d;\
s = src_ind;\
d = dst_ind;\
while(s < length && src_str
{\
dst_str[d] = src_str
d++;\
s++;\
}\
}while(0);
I have tested this for some inputs. Looks like this is performing the
intended functionality.
Please let me know if there are any corrections or any improvements to
be done to this macro.
Thanks