Take FREE!! Online Mettl Mock Test to Crack TechM and Other Companies Written Exams.
Get Off-Campus Placement Jobs Info !!!
TCS NQT Technical and Managerial Round Interview Questions

Program Discussion :: Strings

Home > Programs > Strings

8 / 59

Write a function to implement strncpy using recursion.



int main()
    char s1[100],s2[100];
    int n;
    printf("Enter the string: ");
    printf("Enter the no. of characters to be copied: ");
    printf("String 1: %s ",s1);
    printf("String 2 after performing strncpy(): %s",strncpy(s2,s1,n));
    return 0;

Asked In :: Global Edge

Post Your Answer Here:


Post Your Reply Here: