336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct Datas {
char name[40];
char address[50];
char msg[60];
} ;
void main(){
FILE *fp;
char buffer[1024];
char *temp; int i=0;
struct Datas* data = malloc(sizeof(struct Datas));
fp = fopen("Hello.txt", "r+");
fgets(buffer, 1024, fp);
temp = strtok(buffer, "/");
strcpy(data->name, temp);
temp = strtok(NULL, "/");
strcpy(data->address, temp);
temp = strtok(NULL, "/");
strcpy(data->msg, temp);
printf("%s 님은 %s 에 살구요, %s라고 말을 남겼습니다.\n", data->name, data->address, data->msg);
fclose(fp);
fp = fopen("result.txt", "w+");
fprintf(fp,"%s", data->name);
fprintf(fp,"/");
fprintf(fp,"%s", data->address);
fprintf(fp,"/");
fprintf(fp,"%s", data->msg);
fclose(fp);
free(data);
}
라인단위로 읽어와서 분할해주는 수준입니다... ^^;; 한시간? 정도 사투 끝에 최종적으로 만들게 되었구요..
음.. 뭐랄까.. ObjectStream 으로 하는 간단한 수준을 기대했는데 ㅠㅠ 아닌가봐요.. ㅋ