// mystring.h
void reverse_string(char*);
void reverse_words(char*);
// main.c
#include <stdio.h>
#include “mystring.h”
int main() {
char a[100];
gets(a);
reverse_words(a);
printf("%s\n", a);
return 0;
}
// mystring.c
#include <string.h>
void reverse_words(char *s) {
char b[100], *t, *z;
int c = 0;
t = s;
while(*t) { //processing complete string
while(*t != ' ' && *t != '\0') { //extracting word from string
b[c] = *t;
t++;
c++;
}
b[c] = '\0';
c = 0;
reverse_string(b); // reverse the extracted word
z = b;
while (*z) { //copying the reversed word into original string
*s = *z;
z++;
s++;
}
while (*s == ' ') { // skipping space(s)
s++;
}
t = s; // pointing to next word
}
}
void reverse_string(char *t) {
int l, c;
char *e, s;
l = strlen(t);
e = t + l - 1;
for (c = 0; c < l/2; c++) {
s = *t;
*t = *e;
*e = s;
t++;
e--;
}
}
GDB ❓
GDB, GNU 프로젝트 디버거이며, 프로그램 수행 중에 안에서 일어나고 있는 것들을 보여 주거나 크래쉬가 난 순간에 프그램이 어떤일을 하고 있었는지를 보여준다.
- JDB(Java Debugger)는 Java 클래스를 디버깅할 수 있는 간단한 Command-Line 디버거이다.
- JDB 명령어에 대한 설명은 JDB를 실행하여 -help를 통해서 볼 수 있다.
pudb ❓ : 파이썬 디버깅 도구로 파인썬 인터프리터를 줄마다 보면서 실행할 수 있도록 도와주는 도구