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 is the history of c++?
What is difference between c++ and c ++ 14?
Why do we use structure in c++?
Describe the advantage of an external iterator.
What is type of 'this' pointer? Explain when it is get created?
What is bubble sort c++?
Explain the differences between private, public and protected and give examples.
What are its advantages and disadvantages of multiple inheritances (virtual inheritance)?
How can you quickly find the number of elements stored in a dynamic array? Why is it difficult to store linked list in an array?
Inline parameters : What does the compiler do with the parameters of inline function, that can be evaluated in runtime ?
What is auto used for in c++?
Explain how to initialize a const member data.
Write is a binary search tree? Write an algo and tell complexity?
What is virtual destructor ans explain its use?
Why we use #include iostream in c++?