Answer Posted / ada
char *my_strncpy( char *dst, char *src, size_t n)
{
int i = n;
char *p = dst;
if(!dst || !src)
return dst;
while( i != 0 && *src != '\0' )
{
*p++ = *src++;
i --;
}
while( i!=0 )
{
*p++ = '\0';
i --;
}
return dst;
}
Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
Write a recursive program to calculate factorial in c++.
A mXn matrix is given and rows and column are sorted as shown below.Write a function that search a desired entered no in the matrix .with minimum complexity 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Can you Mention some Application of C/C++?
If we want that any wildcard characters in the command line arguments should be appropriately expanded, are we required to make any special provision? If yes, which?
What is a literal in c++?
What is the difference between public and private data members?
Do class declarations end with a semicolon?
How to declaring variables in c++?
What is abstract keyword in c++?
Is c++ platform dependent?
Can union be self referenced?
How is computer programming useful in real life?
You want to link a c++ program to c functions. How would you do it?
What are the two types of comments?
Is c++ a difficult language?