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 are the basics of local (auto) objects?
List different attributes in C++?
Can I have a reference as a data member of a class? If yes, then how do I initialise it?
Describe linkages and types of linkages?
Is turbo c++ free?
What are the types of array in c++?
Define the process of handling in case of destructor failure?
What is abstract class in c++?
Is it legal in c++ to overload operator++ so that it decrements a value in your class?
What information can an exception contain?
What is the benefit of encapsulation?
Write a program in C++ for Fibonacci series
Show the application of a dynamic array with the help of an example.
What is flag in computer?
Write is a binary search tree? Write an algo and tell complexity?