#include <stdio.h>

#include <stdlib.h>


char* Reverse(char* string, int* size);


int main(void)

{

int i=0,j;

char* string;

printf("거꾸로 하고 싶은 문자열을 입력하세요. : ");

scanf("%s", string);

while (string[i] != NULL)

i++;

int* size = (int*)malloc(sizeof(char[i]));

*string=Reverse(*string, *size);

for (j = 0; j <= i; j++)

printf("%s ", string[j]);

return 0;

}


char* Reverse(char* string, int* size)

{

int i;

char* temp;

for (i = 0; i < *size / 2; i++)

{

*temp = string[*size - i];

string[*size - i] = string[i];

string[i] = *temp;

}

}


일단 코드 짜봤는데 그냥 안돌아가네요

답지 안보고 최대한 노력중이긴한데


언젠간 답이나오겠죠? ^^~