#include <iostream>
using namespace std;

int main()
{
    char a[] = "leeseungwoo";
    char* first = (char*)a;
    char* last = (char *)a + strlen(a) -1;

    while (first < last)
    {
        char temp = *first;
        *first = *last;
        *last = temp;
        
        first++;
        last--;
    }

    cout << a << endl;

}

 

'C' 카테고리의 다른 글

해쉬테이블 기초(간단)  (0) 2020.02.28
C언어 스택, 큐 자료구조 소스 코드  (0) 2020.02.26
C언어 빌드과정(컴파일)  (0) 2020.02.25
C언어 배열 삽입, 삭제  (2) 2020.01.03
C언어 void*  (0) 2019.12.20

+ Recent posts