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 late binding c++?
How does work in c++?
What are pointer-to-members? Explain.
Is swift faster than go?
What is the object serialization?
Why c++ is called oop?
Write a Program for read a line from file from location N1 to N2 using command line arguments. Eg:exe 10 20 a.c
What is ios in c++?
Will a recursive function without an end condition every quit, in practice a) Compiler-Specific (Some can convert to an infinite loop) b) No c) Yes
What is else syntax in c++?
What are the five basic elements of a c++ program?
Can we use this pointer inside static member function?
What is lambda expression c++?
Who was the creator of c++?
What are the advantages of using const reference arguments in a function?