int fgetc(FILE *stream);
char *fgets(char *s, int size, FILE *stream);
int getc(FILE *stream);
int getchar(void);
char *gets(char *s);
int ungetc(int c, FILE *stream);
DESCRIPTION
fgetc() reads the next character from stream and returns it as
an unsigned char cast to an int, or
EOF on end of file or error.
getc() is equivalent to fgetc() except that it may be implemented
as a macro which evaluates stream
more than once.
getchar() is equivalent to getc(stdin).
gets() reads a line from stdin into the buffer pointed to by s
until either a terminating newline or
EOF, which it replaces with '\0'. No check for buffer overrun is
performed (see BUGS below).
fgets() reads in at most one less than size characters from
stream and stores them into the buffer
pointed to by s. Reading stops after an EOF or a newline. If
a newline is read, it is stored into
the buffer. A '\0' is stored after the last character in the
buffer.
ungetc() pushes c back to stream, cast to unsigned char, where it
is available for subsequent read
operations. Pushed - back characters will be returned in reverse
order; only one pushback is guaran?
teed.
Calls to the functions described here can be mixed with each
other and with calls to other input
functions from the stdio library for the same input stream.
주의사항 한글자를 리턴한다고 해서 char형이 아닙니다.,
int형으로 리턴을 하니까 주의하세요..
ps 공부 하시는 김에
1) block buffering
2) line buffering
3) unbuffering
요렇게 구분해서 입출력 함수를 알아 두시면 좋아요/
Re: [질문] math.h 에 대한 초보적 질문입니다만....
gcc -lm math.c
윤미진 wrote..
gcc 로 compile 할때 math.h 에 속해있는 function을 사용하면
undefined reference라는 오류가 나는데요...
/usr/include/math.h 는 있는데... 알수가 없네요....
혹시 아시는 분 없나요?
[질문2] 이런 함수는 없나요?
답변 감사합니다. 잘 되네요....
염치불구하고 하나만 더 문의드립니다....
일반 c에서 getche 와 getchar 차이가 enter를 칠때까지 기다리지 않고 그냥
받아 들이는 것이라고 알고 있는데. gcc에서는 enter를 칠때까지 기다리지 않
고, 한 character만 읽는 함수는 없나요?
string 처리할때 계속 마지막에 읽히는 newline 때문에 골치가 아프네요..
조언 부탁드립니다...
Re^3: [질문2] 이런 함수는 없나요?
한글자씩 읽어 들이는 함수는
getc()란게 있습니다.
요런 무리들을 한번다 올려 드릴께요
SYNOPSIS
#include
int fgetc(FILE *stream);
char *fgets(char *s, int size, FILE *stream);
int getc(FILE *stream);
int getchar(void);
char *gets(char *s);
int ungetc(int c, FILE *stream);
DESCRIPTION
fgetc() reads the next character from stream and returns it as
an unsigned char cast to an int, or
EOF on end of file or error.
getc() is equivalent to fgetc() except that it may be implemented
as a macro which evaluates stream
more than once.
getchar() is equivalent to getc(stdin).
gets() reads a line from stdin into the buffer pointed to by s
until either a terminating newline or
EOF, which it replaces with '\0'. No check for buffer overrun is
performed (see BUGS below).
fgets() reads in at most one less than size characters from
stream and stores them into the buffer
pointed to by s. Reading stops after an EOF or a newline. If
a newline is read, it is stored into
the buffer. A '\0' is stored after the last character in the
buffer.
ungetc() pushes c back to stream, cast to unsigned char, where it
is available for subsequent read
operations. Pushed - back characters will be returned in reverse
order; only one pushback is guaran?
teed.
Calls to the functions described here can be mixed with each
other and with calls to other input
functions from the stdio library for the same input stream.
주의사항 한글자를 리턴한다고 해서 char형이 아닙니다.,
int형으로 리턴을 하니까 주의하세요..
ps 공부 하시는 김에
1) block buffering
2) line buffering
3) unbuffering
요렇게 구분해서 입출력 함수를 알아 두시면 좋아요/
댓글 달기