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 does it mean to declare a member function as static?
List different attributes in C++?
What is java and c++?
What are the 2 main types of data structures?
What is an adjust field format flag?
Describe the syntax of single inheritance in C++?
What is recursion?
What is general format for a prototype?
Is it possible to pass an object of the same class in place of object reference to the copy constructor?
what you know about c++?
What is null c++?
What are the four main data types?
Which software is used for c++ programming?
What is abstract keyword in c++?
Explain the scope of resolution operator.