How to copy string in C

1 Answer

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

int main(void) 
{
    char s[] = "c c++ java";
    char x[20];

    strcpy(x, s); 
    printf("%s\n", x);  
    
    return 0;
}
   
/*
run:

c c++ java

*/

 



answered Aug 4, 2017 by avibootz

Related questions

1 answer 91 views
91 views asked Jun 10, 2024 by avibootz
2 answers 187 views
1 answer 174 views
1 answer 168 views
2 answers 219 views
219 views asked Aug 4, 2017 by avibootz
...