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
Explain Memory Allocation in C/C++ ?
What is exception handling? Does c++ support exception handling?
What are containers in c++?
What is a float in c++?
What is a vector c++?
When there is a global variable and local variable with the same name, how will you access the global variable?
Why do we need function?
What is microsoft c++ redistributable?
Can a new be used in place of old mallocq? If yes, why?
What is the extension of c++?
Can we overload operator in c++?
Comment on assignment operator in c++.
How does c++ structure differ from c++ class?
How long will it take to learn programming?
int age=35; if(age>80) {Console.WriteLine("Boy you are old");} else {Console.WrieLine("That is a good age");}