close

Trust Me!! Trust You!!


  • Blog
  • Local Log
  • Tag Cloud
  • Key Log
  • Guestbook
  • RSS Feed
  • Write a Post
  • Admin

혹시 블로그 스킨이 깨져 보이시나요? 최신버전의 Internet Explorer(Windows용), Opera, Firefox를 사용해보세요.

Found 1 article(s) for 'C Left'.

  1. 2013/06/04 c 언어 substring 만들기

c 언어 substring 만들기

App 프로그래밍
2013/06/04 17:10
 

// x~번째 부터 x 번째 까지 문자열 자르기.. 구현.


#include "stdio.h"
#include "stdlib.h"
#include "string.h"


char *substring(char *input, int i_begin, int i_end);


void main()
{
           char str[12] = "12345678910";

 char *strbuf = (char*)malloc( sizeof(str) / sizeof(str[0]) ); //할당
 memset(strbuf, 0, sizeof(str) / sizeof(str[0]));  //초기화


          strbuf = substring(str, 3, 9); //3번째부터 ~9번째 까지 짜름.. 0based
          printf("%s\n", strbuf);
}


char *substring(char *input, int i_begin, int i_end)
{
     int cnt = 0;
     int size = (i_end - i_begin)+2;
     char *str = (char*)malloc(size);


     memset(str, 0, size);

     for(int i = i_begin; i <= i_end; i++)
     {
          str[cnt] = input[i];
          cnt++;
     }

     return str;
}


*예외 처리따윈 없음.. ㅋㅋ

[출처] c 언어 substring 만들기|작성자 심심

이올린에 북마크하기
TAG C, C Left, c substring, C언어, substr, substring
No received trackback. / No comment.

Trackback Address :: http://viper150.cafe24.com/trackback/228

You can also say.

Prev 1 Next
블로그 이미지
이것저것 불펌금지도 퍼다가 담습니다. 외부에 비공개된 페이지 입니다. By. 어른왕자

카테고리

  • 전체 (298)
    • 사는 이야기 (115)
    • 웹 프로그래밍 (102)
    • App 프로그래밍 (22)
    • IT 뉴스&기타 (22)
    • 박한별 (4)
    • 역사&기타지식 (9)

태그목록

  • 명언
  • 비사
  • api doc
  • 드라마
  • ftp
  • 개통이력
  • 자바스크립트 마우스 막기
  • List
  • 최적화
  • 우문술
  • 착각
  • 속담
  • RedirectAttributes
  • 사진
  • 唐田
  • 관상
  • 레지스트리
  • 잃은것
  • 히든메뉴
  • json
  • getRealPath
  • 텔레비젼
  • 화형
  • 육이오
  • 의료민영화
  • 박근혜
  • 허성도
  • api
  • 생산성저하
  • 황금레시피

최근에 올라온 글

  • 보험사의 조정신청 대응방법.
  • 어느 천재의 앞선 시선.
  • [병맛더빙] 누구게..... (1)
  • 韓경제 `회색 코뿔소` 상황...
  • SVN Connector 설치 URL.
  • 군대를 가지 않는 서울대생.
  • “운은 하늘의 귀여움 받는...
  • 목장에서 알바하다가 캐스...
  • [펌]믿고 거르는 관상.
  • 하루에 1세트씩 하면 좋다...

최근에 달린 댓글

  • 토토사이트클릭 http://xn--py... jekyll 18:19
  • [지엠밴드]토토사이트 ( →【... GM밴드 16:17
  • [지엠밴드]릴게임( →【gosol.... 설 14:30
  • 아이카지노사이트♠?바카라사... stayup 10:16
  • 정품 비아그라 후불제 파는곳... 정품 07:00

최근에 받은 트랙백

  • Fortnite esp. Fortnite esp 15:10
  • access control Hikvision. access control Hikvision 09:51
  • Fortnite CHEAT Free Downloa. Fortnite CHEAT Free Downloa 12/12
  • Fortnite Wallhack. Fortnite Wallhack 12/12
  • Fortnite Hacks. Fortnite Hacks 12/12

글 보관함

  • 2019/03 (1)
  • 2018/12 (1)
  • 2018/09 (1)
  • 2018/08 (1)
  • 2018/02 (1)

달력

«   2019/12   »
일 월 화 수 목 금 토
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        

링크

  • Total : 147277
  • Today : 84
  • Yesterday : 1056
Tattertools
Eolin
rss

어른왕자's blog is powered byTattertools1.1.2.2 : Animato