Salah satu fungsi library yang telah diperkenalkan yaitu cout yaitu untuk mencetak ke layar monitor. Fungsi dikelompokkan menurut jenis dan sifatnya dan disimpan didalam sebuah file yang berekstensi .h. Sebagai contoh fungsi yang digunakan untuk mencetak ke layar monitor (cout) disimpan pada file iostream.h.
Library iostream.h
Standard Input / Output Streams Library.
Elemen iostream library (char instantion) :
Classes :
ios_base Base
ios
istream
ostream
iostream
ifstream
ofstream
fstream
istringstream
ostringstream
stringtream
streambuf
filebuf
stringbuf
Objects :
cin
cout
cerr
clog
Types :
fpos :
streamoff
streampos
streamsize
Manipulators :
boolalpha
dec
endl
ends
fixed
flush
hex
internal
left
noboolalpha
noshowbase
noshowpoint
noshowpos
noskipws
nounitbuf
nouppercase
oct
resetiosflags
right
scientific
setbase
setfill
setiosflags
setprecision
setw
showbase
showpoint
showpos
skipws
unitbuf
uppercase
ws
Objek iostream mewarisi semua anggota yaitu istream dan ostream, sehingga mampu melakukan kedua operasi input dan output.
Library stdio.h
Library stdio.h adalah library pada bahasa C yang digunakan untuk operasi input output (stdio = Standard Input and Output). Tanpa menggunakan library ini maka perintah - perintah input/output tidak dapat dieksekusi atau dijalankan.
Library Functions :
clearr()
fclose()
fccloseall()
fdopen()
fflush()
fgetc()
fgetchar()
fgetpos()
fgets()
flushall()
fopen()
fprint()
fputc()
fputchar()
fputs()
fread()
free()
freopen()
fscan()
fseek()
fsetpos()
ftell()
fwrite()
gets()
getw()
perror()
printf()
puts()
putw()
rename()
rewind()
scanf()
unlink()
Library Macroes :
feof(f)
ferror(f)
fileno(f)
getch(f)
getchar(f)
putchar(f)
remove(path)
Contoh penggunaan library stdio.h dengan library functions printf() dalam program : #include
int main()
{
printf ("saya siswa al bahri\n");
printf ("selamat datang di SMK Al Bahri");
return 0;
}
Contoh penggunaan library stdio.h dengan library functions puts() dalam program :
#include
#include
using namespace std;
int main()
{
char x[20]="SMK Al Bahri";
puts("Sekolah terbaik di kota bekasi ");
puts(x);
return 0;
}
Library math.h
Library math.h merupakan sebuah library yang disediakan untuk melakukan perhitungan secara matematika.
Library Functions :
abs()
acosh()
asin()
atan()
atan2()
atof()
ceil()
cos()
cosh()
exp()
fabs()
floor()
fmod()
labs()
ldexp()
log()
log10()
pow()
sin()
sinh()
sqrt()
tan()
tanh()
Contoh penggunaan library math.h dengan library functions cos() dan sin() dalam program : //Penggunaan library math.h #include
#include
using namespace std;
int main(){
double kecepatan, jarak, sudut;
kecepatan=20;
sudut=25;
jarak = 2*kecepatan*kecepatan*sin(sudut*3.14/180)*cos(sudut*3.14/180)/9.8;
cout<<"Jarak = "< abs()
atof()
atoi()
atol()
div()
exit()
free()
ldiv()
malloc()
rand()
srand()
system()
Library Macroes :
abs(x)
atoi(s)
random(num)
randomize()
Contoh penggunaan library stdlib.h dengan library functions atoi() dalam program : //Penggunaan library stdlib.h #include
#include
using namespace std;
int main(){
char karakter[8]="12.3AB";
int nilai;
nilai=atoi(karakter);
cout< strcpy()
strcat()
strchr()
strcmp()
strlen()
Contoh penggunaan library string.h dengan library functions strcpy() dalam program : //Penggunaan library string.h #include
#include
using namespace std;
int main()
{
char info [30];
strcpy(info,"Nama:RAHMAT HIDAYAT");
cout< clrscr()
getch()
getche()
gotoxy()
khbit()
putch()
Contoh penggunaan library conio.h dengan library funtions getche() atau getch() dalam program : //Penggunaan library conio.h #include
#include
using namespace std;
int main()
{
cout<< "hai, selamt datang di SMK AL BAHRI\n";
getche();
}
Library io.h
Library Functions :
access()
_close()
close()
_creat()
eof()
filelenght()
_open()
open()
_read()
read()
_write()
write()
Library ctype.h Library Functions :
stlower()
toupper()
Library Macroes :
isalnum( c)
isalpha( c)
isascii( c)
iscntrl( c)
isdigit( c)
isgraph( c)
islower( c)
isprint( c)
ispunct( c)
isspace( c)
isupper( c)
isxdigit( c)
toascii( c)
_tolower( c)
_toupper( c)
Salah satu fungsi library yang telah diperkenalkan yaitu cout yaitu untuk mencetak ke layar monitor. Fungsi dikelompokkan menurut jenis dan sifatnya dan disimpan didalam sebuah file yang berekstensi .h. Sebagai contoh fungsi yang digunakan untuk mencetak ke layar monitor (cout) disimpan pada file iostream.h. Library iostream.h Standard Input / Output Streams Library. Elemen iostream library (char instantion) : Classes :
ios_base Base
ios
istream
ostream
iostream
ifstream
ofstream
fstream
istringstream
ostringstream
stringtream
streambuf
filebuf
stringbuf
Objects :
cin
cout
cerr
clog
Types :
fpos :
streamoff
streampos
streamsize
Manipulators :
boolalpha
dec
endl
ends
fixed
flush
hex
internal
left
noboolalpha
noshowbase
noshowpoint
noshowpos
noskipws
nounitbuf
nouppercase
oct
resetiosflags
right
scientific
setbase
setfill
setiosflags
setprecision
setw
showbase
showpoint
showpos
skipws
unitbuf
uppercase
ws
Objek iostream mewarisi semua anggota yaitu istream dan ostream, sehingga mampu melakukan kedua operasi input dan output.
Library stdio.h
Library stdio.h adalah library pada bahasa C yang digunakan untuk operasi input output (stdio = Standard Input and Output). Tanpa menggunakan library ini maka perintah - perintah input/output tidak dapat dieksekusi atau dijalankan.
Library Functions :
clearr()
fclose()
fccloseall()
fdopen()
fflush()
fgetc()
fgetchar()
fgetpos()
fgets()
flushall()
fopen()
fprint()
fputc()
fputchar()
fputs()
fread()
free()
freopen()
fscan()
fseek()
fsetpos()
ftell()
fwrite()
gets()
getw()
perror()
printf()
puts()
putw()
rename()
rewind()
scanf()
unlink()
Library Macroes :
feof(f)
ferror(f)
fileno(f)
getch(f)
getchar(f)
putchar(f)
remove(path)
Contoh penggunaan library stdio.h dengan library functions printf() dalam program : #include
int main()
{
printf ("saya siswa al bahri\n");
printf ("selamat datang di SMK Al Bahri");
return 0;
}
Contoh penggunaan library stdio.h dengan library functions puts() dalam program :
#include
#include
using namespace std;
int main()
{
char x[20]="SMK Al Bahri";
puts("Sekolah terbaik di kota bekasi ");
puts(x);
return 0;
}
Library math.h
Library math.h merupakan sebuah library yang disediakan untuk melakukan perhitungan secara matematika.
Library Functions :
abs()
acosh()
asin()
atan()
atan2()
atof()
ceil()
cos()
cosh()
exp()
fabs()
floor()
fmod()
labs()
ldexp()
log()
log10()
pow()
sin()
sinh()
sqrt()
tan()
tanh()
Contoh penggunaan library math.h dengan library functions cos() dan sin() dalam program : //Penggunaan library math.h #include
#include
using namespace std;
int main(){
double kecepatan, jarak, sudut;
kecepatan=20;
sudut=25;
jarak = 2*kecepatan*kecepatan*sin(sudut*3.14/180)*cos(sudut*3.14/180)/9.8;
cout<<"Jarak = "< abs()
atof()
atoi()
atol()
div()
exit()
free()
ldiv()
malloc()
rand()
srand()
system()
Library Macroes :
abs(x)
atoi(s)
random(num)
randomize()
Contoh penggunaan library stdlib.h dengan library functions atoi() dalam program : //Penggunaan library stdlib.h #include
#include
using namespace std;
int main(){
char karakter[8]="12.3AB";
int nilai;
nilai=atoi(karakter);
cout< strcpy()
strcat()
strchr()
strcmp()
strlen()
Contoh penggunaan library string.h dengan library functions strcpy() dalam program : //Penggunaan library string.h #include
#include
using namespace std;
int main()
{
char info [30];
strcpy(info,"Nama:RAHMAT HIDAYAT");
cout< clrscr()
getch()
getche()
gotoxy()
khbit()
putch()
Contoh penggunaan library conio.h dengan library funtions getche() atau getch() dalam program : //Penggunaan library conio.h #include
#include
using namespace std;
int main()
{
cout<< "hai, selamt datang di SMK AL BAHRI\n";
getche();
}
Library io.h
Library Functions :
access()
_close()
close()
_creat()
eof()
filelenght()
_open()
open()
_read()
read()
_write()
write()
Library ctype.h Library Functions :
stlower()
toupper()
Library Macroes :
isalnum( c)
isalpha( c)
isascii( c)
iscntrl( c)
isdigit( c)
isgraph( c)
islower( c)
isprint( c)
ispunct( c)
isspace( c)
isupper( c)
isxdigit( c)
toascii( c)
_tolower( c)
_toupper( c)
ios_base Base
ios
istream
ostream
iostream
ifstream
ofstream
fstream
istringstream
ostringstream
stringtream
streambuf
filebuf
stringbuf
Objects :
cin
cout
cerr
clog
Types :
fpos :
streamoff
streampos
streamsize
Manipulators :
boolalpha
dec
endl
ends
fixed
flush
hex
internal
left
noboolalpha
noshowbase
noshowpoint
noshowpos
noskipws
nounitbuf
nouppercase
oct
resetiosflags
right
scientific
setbase
setfill
setiosflags
setprecision
setw
showbase
showpoint
showpos
skipws
unitbuf
uppercase
ws
Objek iostream mewarisi semua anggota yaitu istream dan ostream, sehingga mampu melakukan kedua operasi input dan output.
clearr()
fclose()
fccloseall()
fdopen()
fflush()
fgetc()
fgetchar()
fgetpos()
fgets()
flushall()
fopen()
fprint()
fputc()
fputchar()
fputs()
fread()
free()
freopen()
fscan()
fseek()
fsetpos()
ftell()
fwrite()
gets()
getw()
perror()
printf()
puts()
putw()
rename()
rewind()
scanf()
unlink()
Library Macroes :
feof(f)
ferror(f)
fileno(f)
getch(f)
getchar(f)
putchar(f)
remove(path)
Contoh penggunaan library stdio.h dengan library functions printf() dalam program : #include
abs()
acosh()
asin()
atan()
atan2()
atof()
ceil()
cos()
cosh()
exp()
fabs()
floor()
fmod()
labs()
ldexp()
log()
log10()
pow()
sin()
sinh()
sqrt()
tan()
tanh()
Contoh penggunaan library math.h dengan library functions cos() dan sin() dalam program : //Penggunaan library math.h #include
atof()
atoi()
atol()
div()
exit()
free()
ldiv()
malloc()
rand()
srand()
system()
Library Macroes :
abs(x)
atoi(s)
random(num)
randomize()
Contoh penggunaan library stdlib.h dengan library functions atoi() dalam program : //Penggunaan library stdlib.h #include
strcat()
strchr()
strcmp()
strlen()
Contoh penggunaan library string.h dengan library functions strcpy() dalam program : //Penggunaan library string.h #include
getch()
getche()
gotoxy()
khbit()
putch()
Contoh penggunaan library conio.h dengan library funtions getche() atau getch() dalam program : //Penggunaan library conio.h #include
access()
_close()
close()
_creat()
eof()
filelenght()
_open()
open()
_read()
read()
_write()
write()
Library ctype.h Library Functions :
stlower()
toupper()
Library Macroes :
isalnum( c)
isalpha( c)
isascii( c)
iscntrl( c)
isdigit( c)
isgraph( c)
islower( c)
isprint( c)
ispunct( c)
isspace( c)
isupper( c)
isxdigit( c)
toascii( c)
_tolower( c)
_toupper( c)
Salah satu fungsi library yang telah diperkenalkan yaitu cout yaitu untuk mencetak ke layar monitor. Fungsi dikelompokkan menurut jenis dan sifatnya dan disimpan didalam sebuah file yang berekstensi .h. Sebagai contoh fungsi yang digunakan untuk mencetak ke layar monitor (cout) disimpan pada file iostream.h. Library iostream.h Standard Input / Output Streams Library. Elemen iostream library (char instantion) : Classes :
ios_base Base
ios
istream
ostream
iostream
ifstream
ofstream
fstream
istringstream
ostringstream
stringtream
streambuf
filebuf
stringbuf
Objects :
cin
cout
cerr
clog
Types :
fpos :
streamoff
streampos
streamsize
Manipulators :
boolalpha
dec
endl
ends
fixed
flush
hex
internal
left
noboolalpha
noshowbase
noshowpoint
noshowpos
noskipws
nounitbuf
nouppercase
oct
resetiosflags
right
scientific
setbase
setfill
setiosflags
setprecision
setw
showbase
showpoint
showpos
skipws
unitbuf
uppercase
ws
Objek iostream mewarisi semua anggota yaitu istream dan ostream, sehingga mampu melakukan kedua operasi input dan output.
clearr()
fclose()
fccloseall()
fdopen()
fflush()
fgetc()
fgetchar()
fgetpos()
fgets()
flushall()
fopen()
fprint()
fputc()
fputchar()
fputs()
fread()
free()
freopen()
fscan()
fseek()
fsetpos()
ftell()
fwrite()
gets()
getw()
perror()
printf()
puts()
putw()
rename()
rewind()
scanf()
unlink()
Library Macroes :
feof(f)
ferror(f)
fileno(f)
getch(f)
getchar(f)
putchar(f)
remove(path)
Contoh penggunaan library stdio.h dengan library functions printf() dalam program : #include
abs()
acosh()
asin()
atan()
atan2()
atof()
ceil()
cos()
cosh()
exp()
fabs()
floor()
fmod()
labs()
ldexp()
log()
log10()
pow()
sin()
sinh()
sqrt()
tan()
tanh()
Contoh penggunaan library math.h dengan library functions cos() dan sin() dalam program : //Penggunaan library math.h #include
atof()
atoi()
atol()
div()
exit()
free()
ldiv()
malloc()
rand()
srand()
system()
Library Macroes :
abs(x)
atoi(s)
random(num)
randomize()
Contoh penggunaan library stdlib.h dengan library functions atoi() dalam program : //Penggunaan library stdlib.h #include
strcat()
strchr()
strcmp()
strlen()
Contoh penggunaan library string.h dengan library functions strcpy() dalam program : //Penggunaan library string.h #include
getch()
getche()
gotoxy()
khbit()
putch()
Contoh penggunaan library conio.h dengan library funtions getche() atau getch() dalam program : //Penggunaan library conio.h #include
access()
_close()
close()
_creat()
eof()
filelenght()
_open()
open()
_read()
read()
_write()
write()
Library ctype.h Library Functions :
stlower()
toupper()
Library Macroes :
isalnum( c)
isalpha( c)
isascii( c)
iscntrl( c)
isdigit( c)
isgraph( c)
islower( c)
isprint( c)
ispunct( c)
isspace( c)
isupper( c)
isxdigit( c)
toascii( c)
_tolower( c)
_toupper( c)
Anda baru saja membaca artikel yang berkategori dengan judul Library Function pada C dan C++. Anda bisa bookmark halaman ini dengan URL https://rahmatt-albahri.blogspot.com/2015/09/library-function-pada-c-dan-c.html. Terima kasih!
Ditulis oleh:
BGiBola - Thursday, September 10, 2015
Belum ada komentar untuk "Library Function pada C dan C++"
Post a Comment