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 are the characteristics of friend functions?
Define the operators that can be used with a pointer.
How the delete operator differs from the delete[]operator?
What are the advantages of c++?
How would perform Pattern Matching in C++?
What is pair in c++?
What is a template in c++?
Can we make any program in c++ without using any header file and what is the shortest program in c++.
What do you mean by function pointer?
What is the difference between global variables and local variable
What is the difference between #import and #include in c++?
Is it possible to pass an object of the same class in place of object reference to the copy constructor?
what kind of projects are suitable for c and c++
What operators can you overload in c++?
Explain queue. How it can be implemented?