Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
Tags
- log
- Glide
- coroutines
- 다윈
- web3js
- dataginding
- convert
- Android
- 컴파일
- 스트리밍
- Realm
- firebase
- porterduff
- hardwareacceleration
- kotlin
- bigquery
- ethereum
- null safety
- Gradle
- quick-start
- LAYER_TYPE_SOFTWARE
- Hyperledger
- C
- vuepress
- error
- fabic
- test
- 안드로이드
- fabric-sdk-java
- Exception
Archives
- Today
- Total
날마다 새롭게 또 날마다 새롭게
readline - 여러 개의 라인 문자열을 입력받는 함수 구현 코드(포인터 배열) 본문
/* readlines : read input lines */
int readlines(char *lineptr[], int maxlines)
{
int len, nlines;
char *p, line[MAXLEN];
nlines=0;
while(len=getline(line, MAXLEN))>0)
if(nlines >= maxlines || (p=alloc(len))==NULL)
return -1;
else {
line[len-1]='\0';
strcpy(p,line);
lineptr[nlines++]=p;
}
return nlines;
}
Comments