»Ë»Ñ Æ÷·³
°³¹ßÀÚÆ÷·³ ÀÔ´Ï´Ù.
  • ºÏ¸¶Å© ¾ÆÀÌÄÜ

C¾ð¾î µµ¿òÀÌ ÇÊ¿äÇÕ´Ï´Ù! Á¦°¡ ¾´ Äڵ尡 ÀÌÇØ°¡ ¾ÈµË´Ï´Ù ¤Ð¤Ð2

¾È³çÇϼ¼¿ä!

c¾ð¾î¸¦ ±º´ë¿¡¼­ ¹è¿ì°í ÀÖ½À´Ï´Ù :)

Ã¥¿¡¼­ ¹è¿ì°í ½ÎÁö¹æ ¿Â¶óÀÎ ÄÄÆÄÀÏ·¯·Î ¾²¸é¼­ °øºÎÁß¿¡ Àִµ¥¿ä,

ÀÛµ¿Àº Çϴµ¥ ¿Ö ÀÌ·¸°Ô ÀÛµ¿À» ÇÏ´ÂÁö ¸ð¸£°Ú³×¿ä...

¹®Á¦´Â "µÎ ¹®ÀÚ¿­À» °áÇÕÇÑ »õ·Î¿î ¹®ÀÚ¿­À» ÀúÀåÇÒ ¼ö ÀÖµµ·Ï malloc() ÇÔ¼ö¸¦ »ç¿ëÇÏ¿© ¸Þ¸ð¸®¸¦ ÇÒ´çÇÏÀÚ. ÇÔ¼ö´Â »õ·Î¿î ¹®ÀÚ¿­¿¡ ´ëÇÑ Æ÷ÀÎÅ͸¦ µ¹·ÁÁÖ¾î¾ß ÇÑ´Ù. ¿¹¸¦µé¾î Hello¿Í World ¶ó´Â ¹®ÀÚ¿­À» Àü´ÞÇϸé Hello World ¿¡ ´ëÇÑ Æ÷ÀÎÅ͸¦ µ¹·ÁÁØ´Ù" ÀÔ´Ï´Ù.

Á¦°¡ ÀÛ¼ºÇÑ ÄÚµå´Â:

#include
#define max 100

char *func (char*, char *);
char *one, *two;
char three[];
char *ptr;

main()
{

one = malloc(max * sizeof(char));
two = malloc(max *sizeof(char));

puts("enter string one");
gets(one);
puts("enter string two");
gets(two);

*three = func(one, two);

printf("one two together is: %sn", three);

return 0;

}

char *func(char *x, char *y)
{

int a = 0;
int b = 0;

for (a=0; a {
b++;                                                  //b´Â a¶û °°ÀÌ 1¾¿ ¿Ã¶ó x¹è¿­ÀÌ ³¡³ªµµ three¹è¿­ÀÇ ³¡ºÎºÐÀ» À¯ÁöÇÒ¼ö ÀÖµµ·Ï °°ÀÌ ¿Ã·ÁÁÝ´Ï´Ù.
if (x[a] == NULL) {    a = 100;    }
else three[a] = x[a]
}

for (a=0; a {
if (y[a] == NULL) {a = 100;   }
else {    three[b]  = y[a];
            b++;                      }

return(three);
}


Á¦ Äڵ尡 ¸¹ÀÌ ºÒ¾ÈÁ¤ÇÕ´Ï´Ù.
ÀÌ·¸°Ô Ǫ´Â ¹®Á¦°¡ ¸Â³ª¿ä?
µµ¿ÍÁÖ¼¼¿ä!

0
ÃßõÇϱ⠴ٸ¥ÀÇ°ß 0
|
°øÀ¯¹öÆ°

´Ù¸¥ÀÇ°ß 0 Ãßõ 0 »þÀ̺¸ÀÌ

´Ù¸¥ÀÇ°ß 0 Ãßõ 0 ¸®¹Ù°Ôµ·
  • ¾Ë¸² ¿å¼³, »óó ÁÙ ¼ö ÀÖ´Â ¾ÇÇÃÀº »ï°¡ÁÖ¼¼¿ä.
©¹æ »çÁø  
¡â ÀÌÀü±Û¡ä ´ÙÀ½±Û ¸ñ·Ïº¸±â