>kata; pjg =(strlen(kata)); cout<<"panjang karakter : "< Upload presentasi Presentasi sedang didownload. Silahkan tunggu
1
Beberapa Fungsi string dalam c++
2
Fungsi String (strlen)
3
Fungsi String (strcat)
4
Fungsi String (strcpy)
5
Fungsi String (strrev)
6
Fungsi String (strchr)
Presentasi serupa © 2024 SlidePlayer.info Inc.
Presentasi serupa
Presentasi berjudul: "Beberapa Fungsi string dalam c++"— Transcript presentasi:
#include<string.h> #include<conio.h> #include<iostream.h> main() {char kata[10]; int pjg; cout<<"kata : "; cin>>kata; pjg =(strlen(kata)); cout<<"panjang karakter : "<<pjg; }
#include<string.h> #include<conio.h> #include<iostream.h> main() {char kt1[10], kt2[10]; cout<<"kata 1 : "; cin>>kt1; cout<<"kata 2 : "; cin>>kt2; cout<<strcat(kt1,kt2); }
#include<string.h> #include<conio.h> #include<iostream.h> main() { char kt1[10], kt2[10]; cout<<"kata 1 : "; cin>>kt1; strcpy(kt2,kt1); cout<<"kata 2 : "<<kt2; }
#include<string.h> #include<conio.h> #include<iostream.h> main() {char kata[20]; cout<<"masukkan sembarang kata = "; cin>>kata; strrev(kata); cout<<"hasil perubahan = "<<kata; }
#include<string.h> #include<conio.h> #include<iostream.h> main() {char *kalimat = "ujian akhir semester"; char *p; p=strchr(kalimat,'m'); cout<<"hasil = "<<p; }
Presentasi serupa
All rights reserved.