Nama   : Lisen Danelp
N.I.M  : 12131291
Kelas   : 12.2C.06

Fungsi strcpy() digunakan untuk menggabungkan dua string menjadi satu.

//Contoh Program Menggunakan strcpy()

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



void main()
{
   char kata1[50];
   char kata2[50];

   clrscr();

   cout<<"Masukan kata yang ingin dicopy : ";
   gets(kata1);

   strcpy(kata2,kata1);

   cout<<"Hasil dari copy adalah               : "<<kata2<<endl;

   getch();
}

Dan berikut adalah tampilan program ketika runing

Tampilan program dengan kode strcpy()

Post a Comment

  1. Iron Dog, the tusked dog in the online gambling industry, the
    Iron titanium men\'s wedding band Dog, the tusked dog in the online hypoallergenic titanium earrings gambling industry, the first dog, was a bit 2019 ford ecosport titanium afraid of having titanium scooter bars dogs with dogs in a casino gr5 titanium game,

    ReplyDelete

 
Top