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 do you mean by persistent and non persistent objects?
Explain "const" reference arguments in function?
How new/delete differs from malloc()/free?
Explain what are mutator methods in c++?
What is a constructor in c++ with example?
What are advantages of c++?
Is c++ vector dynamic?
What is c++ try block?
If you hear the cpu fan is running and the monitor power is still on, but you did not see anything show up in the monitor screen. What would you do to find out what is going wrong?
Do you know what are static and dynamic type checking?
Which operator cannot overload?
Explain the different access specifiers for the class member in c++.
What is the purpose of ios::basefield in the following statement?
What is oops in c++?
Explain shallow copy?