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 do you mean by persistent and non persistent objects?
Distinguish between new and malloc and delete and free().
Which is better c++ or java?
What is the difference between structure and class?
Does c++ support exception handling?
what are the types of Member Functions?
Define Virtual function in C++.
What is an object in c++?
What is the difference between global variables and local variable
How did c++ get its name?
Difference between a homogeneous and a heterogeneous container
What is the use of pointer in c++ with example?
What does the ios::ate argument do?
What is :: operator in c++?
How compile and run c++ program in turbo c++?