Answer Posted / shanmugavalli
char* strncpy(char* dest,const char* src,int n)
{
while(n>0)
{
if (!(*dest = *src)) break;
src++;
dest++;
n--;
}
if (n<=0) *dest = '\0';
return dest;
}
| Is This Answer Correct ? | 3 Yes | 4 No |
Post New Answer View All Answers
What is the difference between prefix and postfix versions of operator++()?
Why cout is used in c++?
What is the use of dot in c++?
What is object file? How can you access object file?
What are the steps in the development cycle?
What are the benefits of c++?
Is it possible to provide special behavior for one instance of a template but not for other instances?
Why do we use structure in c++?
Why struct is used in c++?
What is array give example?
What is the size of integer variable?
What do you mean by “this” pointer?
Explain the problem with overriding functions
What programming language should I learn first?
What are separators in c++?