• 캠퍼스북
  • 파일시티 이벤트
  • LF몰 이벤트
  • 서울좀비 이벤트
  • 탑툰 이벤트
  • 닥터피엘 이벤트
  • 아이템베이 이벤트
  • 아이템매니아 이벤트

[C언어] call by reference 응용함수 (문자열, 숫자 sorting)

*재*
개인인증판매자스토어
최초 등록일
2011.05.09
최종 저작일
2011.04
4페이지/파일확장자 압축파일
가격 5,000원 할인쿠폰받기
다운로드
장바구니

소개글

1. Write the following function
int strFind(char *s, char* t, int sLength, int tLength, int startIndex);
Find the starting position of target string in the source string after startIndex
If there is no result, return -1
Examples:
strFind(“hamburger”, “burger”, 9, 6, 0) ->return 3 (not 4)
strFind(“comecomecome”, “come”, 12, 4, 0) -> return 0
strFind(“comecomecome”, “come”, 12, 4, 2) -> return 4 (not 0)
strFind(“ababab”, “abc”, 6, 3, 0) -> return -1

2. Sort three integer values
Three values are entered as pointer
You may need to make new variable(s) in sort3 function
Examples:
void main() { int a, b, c; a = 3; b = 2; c = 1; sort3(&a, &b, &c); printf(“After sort3 : %d %d %d”, a, b, c); }
Result :

목차

1. introduction
2.source code
3. result

본문내용

include<stdio.h>
int strFind(char *s, char *t, int sLength, int tLength, int startIndex);
void sort3(int *n1, int *n2, int *n3);
int main(void)
{
char *fullname=NULL;
char *partname=NULL;
int index=-1;
int a,b,c;
index=strFind("kojaehyun", "jaehyun",9,7,0);
printf("Result of strFind( "kojaehyun", "jaehyun", 9, 7, 0 )t is %d n", index);

index=strFind("comecomecome", "comecome",12,4,2);
printf("Result of strFind( "comecomecome", "come", 12, 8, 2 )t is %d n", index);

index=strFind("Network", "ya",7,2,2);
printf("Result of strFind( "Network", "ya", 7, 2, 2 )t is %d n", index);

index=strFind("ababab", "abc",6,3,0);
printf("Result of strFind( "ababab", "abc", 6, 3, 0 )t is %d n", index);

printf( "n" );

a = 3, b = 2, c = 1;

printf( "Before sort3: %d %d %dn", a, b, c );
sort3( &a, &b, &c );

) 같은 문자가 있을 경우 이번엔 target 문자열이 source 문자열에 포함되는지 확인한다.
이번엔 tLength를 이용하여 source 문자열과 target 문자열의 각각의 문자를 하나씩 비교한다.
->모두 같으면 return i (여기서 i는 target 문자의 첫번째 문자가 일치하는 sorurce문자열의 index)

참고 자료

없음
*재*
판매자 유형Bronze개인인증

주의사항

저작권 자료의 정보 및 내용의 진실성에 대하여 해피캠퍼스는 보증하지 않으며, 해당 정보 및 게시물 저작권과 기타 법적 책임은 자료 등록자에게 있습니다.
자료 및 게시물 내용의 불법적 이용, 무단 전재∙배포는 금지되어 있습니다.
저작권침해, 명예훼손 등 분쟁 요소 발견 시 고객센터의 저작권침해 신고센터를 이용해 주시기 바랍니다.
환불정책

해피캠퍼스는 구매자와 판매자 모두가 만족하는 서비스가 되도록 노력하고 있으며, 아래의 4가지 자료환불 조건을 꼭 확인해주시기 바랍니다.

파일오류 중복자료 저작권 없음 설명과 실제 내용 불일치
파일의 다운로드가 제대로 되지 않거나 파일형식에 맞는 프로그램으로 정상 작동하지 않는 경우 다른 자료와 70% 이상 내용이 일치하는 경우 (중복임을 확인할 수 있는 근거 필요함) 인터넷의 다른 사이트, 연구기관, 학교, 서적 등의 자료를 도용한 경우 자료의 설명과 실제 자료의 내용이 일치하지 않는 경우

이런 노하우도 있어요!더보기

최근 본 자료더보기
탑툰 이벤트
[C언어] call by reference 응용함수 (문자열, 숫자 sorting)
  • 레이어 팝업
  • 레이어 팝업
  • 레이어 팝업