티스토리 뷰
How To sscanf() Example Using a Comma (,) as Delimiter
Article ID | : | 38335 |
Last Review | : | July 13, 2004 |
Revision | : | 3.1 |
This article was previously published under Q38335
On This Page
SUMMARY
The example below shows how to use the sscanf() C run-time function to read from an internal buffer delimiting fields with a comma (,). The key is to use the brackets in the format of sscanf() function. The format will be %[^','], which tells the function to read from the buffer until a comma (,) is reached.
Sample Code
/* The following sample illustrates the use of brackets and the
caret (^) with sscanf().
Compile options needed: none
*/
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
char *tokenstring = "first,25.5,second,15";
int result, i;
double fp;
char o[10], f[10], s[10], t[10];
void main()
{
result = sscanf(tokenstring, "%[^','],%[^','],%[^','],%s", o, s, t, f);
fp = atof(s);
i = atoi(f);
printf("%s\n %lf\n %s\n %d\n", o, fp, t, i);
}
'IT > 프로그래밍' 카테고리의 다른 글
전처리문 (#include, #define, #if, #error, #line, #pragma, ...) [펌 cafe.naver.com/devctrl.cafe] (0) | 2008.01.21 |
---|---|
How To Implement a Recursive RegDeleteKey for Windows NT (0) | 2008.01.20 |
MSDN CFileDialog - 한글 (1) | 2008.01.18 |
__stdcall, __cdecl [펌 keegan.tistory.com] (0) | 2008.01.16 |
reentrant ; 재진입성 (0) | 2007.12.28 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
- 지루박멸연구센타
- 열정의 힘을 믿는다
- Le4rN TO Cr4cK
- 디버깅에관한모든것(DebugLab)
- sysinternals
- FoundStone
- hashtab
- 보안-coderant
- 디바이스드라이버 개발자 포럼
- dualpage.muz.ro
- osronline.com - 드라이버 관련 정보 사이트
- NtInternals - NativeAPI Refere…
- pcthreat - spyware 정보 제공
- rootkit.com - 루트킷 관련 정보
- www.ntinternals.net
- WINE CrossRef. - source.winehq…
- tuts4you
- hex-rays
- idapalace
- idefense
- immunityinc
- threatexpert
- hdp.null2root.org
- www.crackstore.com
- crackmes.de
- www.who.is
- www.cracklab.ru
- community.reverse-engineering.…
- video.reverse-engineering.net
- SnD
- 클레이 키위
- reversengineering.wordpress.co…
- www.openrce.org
- www.woodmann.com
- PEID.Plusins.BobSoft
- roxik.com/pictaps/
- regexlib.com
- spyware-browser.com
- www.usboffice.kr
- regulator
- www.txt2re.com
- ietab.mozdev.org
- zesrever.xstone.org
- www.heaventools.com/PE-file-he…
- www.heaventools.com
- www.innomp3.com
- 울지않는벌새
- exetools.com-forum
- exetools.com
- utf8 conv
- robtex - IP trace
- onsamehost - same IP sites
- JpopSuki
- jsunpack.jeek.org
- wepawet.iseclab.org
- www.jswiff.com
- www.hackeroo.com
- winesearcher.co.kr
- khpga.org
- malwareurl.com
- anubis.iseclab.org
- www.crummy.com-eautifulSoup
- malwarebytes.org/forums
- bbs.janmeng.com
- blackip.ustc.edu.cn
- eureka.cyber-ta.org
- exploit-db.com
TAG
- SBI저축은행
- 주식트래이딩
- 매매가격지수
- PIR
- 주식
- 실시간트래이딩
- ROA
- O365
- 자동트래이딩
- ubuntu
- Pivot
- ChatGPT
- 레고랜드
- 미국주식
- hai
- CriticalSection
- 시스템트래이딩
- INVOICE
- 사회간접자본
- 다올저축은행
- 주택구매력지수
- systemd
- 맥쿼리인프라
- 피봇
- 전세매매지수
- 군함도
- ElasticSearch
- 공공인프라
- 신한저축은행
- logrotate
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
글 보관함