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 different types of loops in c++?
Explain how an exception handler is defined and invoked in a Program.
Is empty stack c++?
What is the outcome of cout< a) 16 b) 17 c) 16.5
By using c++ with an example describe linked list?
If I is an integer variable, which is faster ++i or i++?
How are the features of c++ different from c?
what do you mean by volatile variable?
Is eclipse good for c++?
What flag means?
Why c++ is faster than java?
How do you initialize a string in c++?
State two differences between C and C++.
What are friend functions in C++?
Explain the differences between list x; & list x();.