Minggu, 27 November 2011

Reserved Word dan Library dalam Bahasa C

Struktur utama bahasa C

main()
{
statement;
statement;
statement;
}

Reserved word
auto
break
case
char
const
continue
default
do
double
else
enum
extern
float
for
goto
if
int
long
register
return
short
signed
sizeof
static
sturct
switch
typedef
union
unsigned
void
volatile
while

Library functions

 syntax:  

#include < standart header file >
 

di dalam standart header file terdapat kumpulan perintah (library function) yang memiliki fungsi masing-masing. Apabila akan menjalankan perintah tersebut, kita harus menambahkan
#include < standart header file > di bagian atas agar perintah tersebut dikenali dan dijalankan.
contoh:
#include < stdio.h >
digunakan untuk fungsi standard input output
clearr()
fccloseall()
fdopen()
fflush()
fgetc()
fgetchar()
fgetpos()
fgets()
flushall()
fputc()
fputchar()
fputs()
fread()
free()
freopen()
fseek()
fsetpos()
ftell()
fwrite()
getw()
perror()
putw()
rename()
rewind()
unlink()
printf()
scanf()
gets()
puts()
fprinf()
fscan()
fclose()
fopen()

#include < math.h >
digunakan untuk fungsi matematika
abs()
acosh()
asin()
atan()
atan2()
atof()
cosh()
fmod()
labs()
ldexp()
sinh()
tanh()
sin()
cos()
tan()
fabs()
ceil()
floor()
pow()
sqrt()
exp()
log()
log10()

#include < stdlib.h >
digunakan untuk fungsi standard library
abs()
atof()
atoi()
atol()
div()
exit()
free()
ldiv()
malloc()
rand()
system()

#include < string.h >
digunakan untuk fungsi string
strcpy()
strcat()
strchr()
strcmp()
strlen()
 
#include < ctype.h >
digunakan untuk fungsi character type
stlower()
toupper()

#include < conio.h >
digunakan untuk fungsi console input/output
clrscr()
getch()
getche()
gotoxy()
khbit()
putch()

#include < io.h >
digunakan untuk fungsi input/output
access()
_close()
close()
_creat()
eof()
filelength()
_ope()
open()
_read()
read()
_write()
write()

Tidak ada komentar:

Posting Komentar