Answers for "strcpy in c"

C
13

strcpy

/* strcpy example */
#include <stdio.h>
#include <string.h>

int main ()
{
  char str1[]="Sample string";
  char str2[40];
  char str3[40];
  strcpy (str2,str1);//str1 copies to str2
  strcpy (str3,"copy successful");
  printf ("str1: %s\nstr2: %s\nstr3: %s\n",str1,str2,str3);
  return 0;
}
Posted by: Guest on March-05-2020
2

strcpy en c

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
 
int main()
{
    char Temp[255];
    strcpy(&Temp,"Gladir");
    strcpy(&Temp,"ABC");
    strcpy(&Temp,"Gladir.com");
    puts(&Temp);
    return 0;
}
Posted by: Guest on March-30-2021
1

strcpy in C

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

int main() {
   char str1[20] = "C programming";
   char str2[20];

   // copying str1 to str2
   strcpy(str2, str1);

   puts(str2); // C programming

   return 0;
}
Posted by: Guest on May-20-2021
0

strcpy in c

char *strcpy(char *dest, const char *src)
Posted by: Guest on September-22-2021

Code answers related to "C"

Browse Popular Code Answers by Language