블로그 이미지
송시혁

calendar

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

Notice

Tag

Recent Post

Recent Comment

Recent Trackback

Archive






#include <stdio.h>
#include <string.h>
int mystrlen(const char* );

int main()
{
  int length;
  int size;
  
  length = mystrlen ("string");
  size = sizeof ("string");
  printf("string length : %d\n", length);//크기계산.
  printf("string size : %d\n", size);


  return 0;
}

int mystrlen(const char *ccp)
{
  int icnt= 0;
  while(1)
  {
    
    if(0==*ccp)
    {
      break;
    }    
    ++icnt;
    ++ccp;
    
  }   
  return (icnt);

  
}

posted by 송시혁