|
http://www.hackerschool.org/HS_Boards/zboard.php?AllArticle=true&no=2992 [º¹»ç]
php ÄÚµùÀ» ÇÏ´Ù ¿½ÉÈ÷ ¹è¿î C¸¦ ±î¸Ô±âÀü¿¡ ´Ù½Ã Çѹø ¸®ºä ÇÏ´øÁß
°©ÀÚ±â ÀÌÇØ°¡ ¾ÈµÅ´Â ºÎºÐ :(
#include <stdio.h>
#include <string.h>
void Replace(char *theString);
int main(){
char string[10] = "hello";
Replace(string);
puts(string);
}
void Replace(char *theString){
int len = strlen(*theString);
*theString[len -1] = '\0';
}
// string ¿¡¼ ¸¶Áö¸· ±ÛÀÚ¸¦ '\0' ·Î ¹Ù²Ù´Â °Çµ¥¿ä
ÇÔ¼ö Replace ¿¡ ÀÖ´Â µÎ *theString µéÀ» ±×³É theString À¸·Î ¹Ù²Ù´Ï ÇÁ·Î±×·¥ÀÌ Á¦´ë·Î µ¹¾Æ°¡´õ±º¿ä ....
¿Ö theString ÀÌÁÒ? ¿ø·¡ theStringÀº "string" ÀÇ ÁÖ¼Ò¸¦ °¡Áö°í ÀÖ°í *theString À» ÀÌ¿ëÇØ¾ßÁö value ¸¦ ¹Ù²Ü¼ö
Àִ°Š¾Æ´Ñ°¡¿ä? |
Hit : 4185 Date : 2011/05/12 12:24
|