Mercurial > hg > Applications > Grep
view c/strlen.c @ 99:1e5b56e8263b impl-bitvector
remove some variable
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 10 Nov 2015 20:57:59 +0900 |
parents | c1968e54b0da |
children |
line wrap: on
line source
#include <stdio.h> #include <stdlib.h> #include <string.h> unsigned char *gWord = 0; int main(){ gWord = "testcode"; int w_len = sizeof(gWord); unsigned char *word = (unsigned char *)malloc(w_len + 1); memcpy(word,gWord,w_len + 1); printf("%s\n",word); printf("length:%d\n",w_len); free(word); return 0; }