Answer Posted / ada
char *my_strncpy( char *dst, char *src, size_t n)
{
int i = n;
char *p = dst;
if(!dst || !src)
return dst;
while( i != 0 && *src != '\0' )
{
*p++ = *src++;
i --;
}
while( i!=0 )
{
*p++ = '\0';
i --;
}
return dst;
}
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
What methods can be overridden in java?
What is the difference between a pointer and a link in c ++?
Does c++ have string data type?
Explain what are the sizes and ranges of the basic c++ data types?
What are virtual functions in c++?
Why is c++ is better than c?
What is abstract keyword in c++?
Array base access faster or pointer base access is faster?
What is a buffer c++?
What is c++ vb?
Why we use #include conio h in c++?
What is array give example?
What is const pointer and const reference?
What is a float in c++?
Can I uninstall microsoft c++ redistributable?