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 243 views
1 answer 185 views
1 answer 188 views
188 views asked Apr 6, 2022 by avibootz
1 answer 201 views
1 answer 220 views
220 views asked Apr 6, 2022 by avibootz
1 answer 202 views
1 answer 192 views
...