How to use strncat_s (strncat) in windows with C

1 Answer

0 votes
#include <windows.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h> 

int main(void)
{
    char s[16] = "programming";
    char dest[32] = "c windows ";
    
    strncat_s(dest, _countof(dest), s, _countof(s));

    printf("%s\n", dest);

    char ch = getchar();

    return 0;
}
 



/*
run:

c windows programming

*/

 



answered Apr 5, 2022 by avibootz

Related questions

2 answers 370 views
1 answer 286 views
1 answer 311 views
311 views asked Apr 6, 2022 by avibootz
1 answer 313 views
1 answer 341 views
341 views asked Apr 6, 2022 by avibootz
1 answer 330 views
1 answer 297 views
...