'모든글모음'에 해당되는 글 895건

  1. 2009.05.01 컴터가 폭발하려고 한다
  2. 2009.04.28 monolog skin
  3. 2009.01.02 Debug Mode - Enable
  4. 2008.12.11 Vantage Master Tatics V2
  5. 2008.12.09 NeverWinterNights 최종보스전
  6. 2008.12.07 NeverWinterNights1 Versus RedDragon
  7. 2008.12.02 NeverWinterNights1 ZombieKing VS
  8. 2008.12.02 C++ , C File OUTPUT e.g.
  9. 2008.12.02 simple fgets source code
  10. 2008.11.29 Sprintf part1



신기하단 말야... 160aajs 는 의외로 상당히 정숙한편임...
물론 하드는 죽어나고 계시겠지만... 지못미 ㅠㅠ

'Volatile' 카테고리의 다른 글

그동안 즐거웠다  (0) 2009.05.11
모社의 webhard  (0) 2009.05.07
걍 10년까지는...  (0) 2009.05.04
RGB32 와 YUV12 차이  (0) 2009.05.03
monolog skin  (0) 2009.04.28
Posted by 쵸코케키

2009. 4. 28. 22:24 Volatile

monolog skin





아!! egloos monolog skin tistory로 컨버팅 해줄때까지 여긴 잠수...
도저히 css 건드릴 삽질할 인내심이 남아있지를 않아서 포기

아니 도대체 왜 이상하게 포매팅해서 구성해놓았는지
도통 수정 아오 ㅈㅈ염

'Volatile' 카테고리의 다른 글

그동안 즐거웠다  (0) 2009.05.11
모社의 webhard  (0) 2009.05.07
걍 10년까지는...  (0) 2009.05.04
RGB32 와 YUV12 차이  (0) 2009.05.03
컴터가 폭발하려고 한다  (0) 2009.05.01
Posted by 쵸코케키

2009. 1. 2. 11:46 devel/etc

Debug Mode - Enable



구성 속성 -> 링커 -> 디버깅 -> 디버그 정보 생성 : 예(/DEBUG)
구성 속성 -> C/C++ -> 일반 -> 디버깅 정보 형식 -> 편집하며 계속하기를 위한 프로그램 데이터베이스(/ZI)
구성 속성 -> C/C++ -> 최적화 -> 최적화 : 사용 안 함(/Od)  





http://support.microsoft.com/kb/198953
watch 창에 "포인터 변수 이름,숫자"



char* ptr="abcdefg"; 가 있을 때 watch 창에 "ptr,5"라고 쓰면 a,b,c,d,e가 들어있는 5칸짜리 배열로 보여

continue하면 반복문의 처음으로 가게됨
ex> whlie
         a
for(c++)
b continue;


c가 ++되고 b출력되면서 계속 반복
a는 초기1회밖에

'devel > etc' 카테고리의 다른 글

Makefile 쉬운 예제  (1) 2009.10.17
윤드림훃의 주옥같은 글  (0) 2009.10.17
simple fgets source code  (0) 2008.12.02
File To String in C++  (0) 2008.05.27
class member 접근과 클래스 내에서 클래스 선언해서 쓰기  (0) 2007.04.26
Posted by 쵸코케키

2008. 12. 11. 08:51 Game/etc

Vantage Master Tatics V2

사용자 삽입 이미지


사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지

'Game > etc' 카테고리의 다른 글

ip로 멀티플레이 할 수 있는 간단한 게임들 목록  (6) 2009.10.24
The Very End of You  (0) 2009.05.11
NeverWinterNights 최종보스전  (0) 2008.12.09
NeverWinterNights1 Versus RedDragon  (0) 2008.12.07
NeverWinterNights1 ZombieKing VS  (0) 2008.12.02
Posted by 쵸코케키
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지

'Game > etc' 카테고리의 다른 글

ip로 멀티플레이 할 수 있는 간단한 게임들 목록  (6) 2009.10.24
The Very End of You  (0) 2009.05.11
Vantage Master Tatics V2  (0) 2008.12.11
NeverWinterNights1 Versus RedDragon  (0) 2008.12.07
NeverWinterNights1 ZombieKing VS  (0) 2008.12.02
Posted by 쵸코케키
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지

'Game > etc' 카테고리의 다른 글

ip로 멀티플레이 할 수 있는 간단한 게임들 목록  (6) 2009.10.24
The Very End of You  (0) 2009.05.11
Vantage Master Tatics V2  (0) 2008.12.11
NeverWinterNights 최종보스전  (0) 2008.12.09
NeverWinterNights1 ZombieKing VS  (0) 2008.12.02
Posted by 쵸코케키

'Game > etc' 카테고리의 다른 글

ip로 멀티플레이 할 수 있는 간단한 게임들 목록  (6) 2009.10.24
The Very End of You  (0) 2009.05.11
Vantage Master Tatics V2  (0) 2008.12.11
NeverWinterNights 최종보스전  (0) 2008.12.09
NeverWinterNights1 Versus RedDragon  (0) 2008.12.07
Posted by 쵸코케키


///////////
★★★C method 1
///////////
#include <stdio.h>
#include <stdlib.h>

#define INPUT_FILE_1 "hw1_in1"
#define OUTPUT_FILE_1 "hw1_out1"

void ReadFile();
void WriteFile();
void ParseLine(char * pLineBuf);

int main()
{

 printf("\n\n");
 printf("%s : file read\n", INPUT_FILE_1);
 printf("====================================\n");
 
 ReadFile();
 
 printf("\n\n");
 printf("%s : file write\n", OUTPUT_FILE_1);
 printf("====================================\n");
 
 WriteFile();

 printf("\n\n");
 return 0;
}

void ReadFile()
{
 char buf[256];
 FILE * fp;

 fp = fopen(INPUT_FILE_1, "r");
 
 if (fp == NULL)
 {
  printf("%s file open error\n", INPUT_FILE_1);
  exit(0);
 }

 while(!feof(fp))
 {
  fgets(buf, sizeof(buf), fp);

  ParseLine(buf);
 }
 
 fclose(fp);
}

void WriteFile()
{
 int i;
 float f;
 char buf[256];
 FILE * fp;

 fp = fopen(OUTPUT_FILE_1, "w");
 
 if (fp == NULL)
 {
  printf("%s file open error\n", INPUT_FILE_1);
  exit(0);
 }

 fprintf(fp, "---------------------------------\n");
 fprintf(fp, " %s file write test\n", OUTPUT_FILE_1);
 fprintf(fp, "---------------------------------\n");
 
 f = 0.0;
 
 for (i = 0; i < 5; i++)
 {
  fprintf(fp, " %.2f\t%.2f\t%.2f\n", f + 1, f + 1, f + 1);
  f++;
 }
 
 fclose(fp);
}


// 이 함수에서 파싱을 합니다
void ParseLine(char * pLineBuf)
{
 printf("%s", pLineBuf);

}


C++
http://www.cplusplus.com/reference/iostream/ifstream/open.html

this is reference and easy to use

#include

ofstream output;
output.open("filename" ios::out | ios::trunc);


if(output.is_open())
output << "anything if you wanna";

 

'devel > man & example' 카테고리의 다른 글

scanf에서 fflush(stdin) 사용 안하고 \n 파싱해서 없애기  (2) 2011.11.27
function pointer  (0) 2009.11.24
sprintf int to ascii  (0) 2009.11.08
String Parsing  (0) 2008.05.25
bit shift e.g. , 2dim matrix, Defed Func  (0) 2007.05.01
Posted by 쵸코케키

2008. 12. 2. 15:28 devel/etc

simple fgets source code

/*-
 * Copyright (c) 1990, 1993
 * The Regents of the University of California.  All rights reserved.
 *
 * This code is derived from software contributed to Berkeley by
 * Chris Torek.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 4. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */

#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)fgets.c 8.2 (Berkeley) 12/22/93";
#endif /* LIBC_SCCS and not lint */
#include <sys/cdefs.h>
__FBSDID("$FreeBSD: src/lib/libc/stdio/fgets.c,v 1.14 2007/01/09 00:28:06 imp Exp $");

#include "namespace.h"
#include <stdio.h>
#include <string.h>
#include "un-namespace.h"
#include "local.h"
#include "libc_private.h"

/*
 * Read at most n-1 characters from the given file.
 * Stop when a newline has been read, or the count runs out.
 * Return first argument, or NULL if no characters were read.
 */

char *
fgets(buf, n, fp)
 char *buf;
 int n;
 FILE *fp;
{
 size_t len;
 char *s;
 unsigned char *p, *t;

 if (n <= 0)  /* sanity check */
  return (NULL);

 FLOCKFILE(fp);
 ORIENT(fp, -1);
 s = buf;
 n--;   /* leave space for NUL */
 while (n != 0) {
  /*
   * If the buffer is empty, refill it.
   */
  if ((len = fp->_r) <= 0) {
   if (__srefill(fp)) {
    /* EOF/error: stop with partial or no line */
    if (s == buf) {
     FUNLOCKFILE(fp);
     return (NULL);
    }
    break;
   }
   len = fp->_r;
  }
  p = fp->_p;

  /*
   * Scan through at most n bytes of the current buffer,
   * looking for '\n'.  If found, copy up to and including
   * newline, and stop.  Otherwise, copy entire chunk
   * and loop.
   */

  if (len > n)
   len = n;
  t = memchr((void *)p, '\n', len);
  if (t != NULL) {
   len = ++t - p;
   fp->_r -= len;
   fp->_p = t;
   (void)memcpy((void *)s, (void *)p, len);
   s[len] = 0;
   FUNLOCKFILE(fp);
   return (buf);
  }
  fp->_r -= len;
  fp->_p += len;
  (void)memcpy((void *)s, (void *)p, len);
  s += len;
  n -= len;
 }
 *s = 0;
 FUNLOCKFILE(fp);
 return (buf);
}

'devel > etc' 카테고리의 다른 글

Makefile 쉬운 예제  (1) 2009.10.17
윤드림훃의 주옥같은 글  (0) 2009.10.17
Debug Mode - Enable  (0) 2009.01.02
File To String in C++  (0) 2008.05.27
class member 접근과 클래스 내에서 클래스 선언해서 쓰기  (0) 2007.04.26
Posted by 쵸코케키

2008. 11. 29. 09:41 devel

Sprintf part1




설명

메모리 영역으로 서식에 맞추어 출력합니다. 아래의 서식 변환 문자열을 참고하십시오.

변환 문자열 의미
%o 8진 정수 형식으로 출력
%d 10진 정수 형식으로 출력
%ld long형 10진 정수 형식으로 출력
%x 16진 정수 형식으로 출력
%u 부호 없는 10진 정수 형식으로 출력
%f 소수점 형식으로 출력
%e %E 지수 형식으로 출력
%g %G %e와 %f 중 짧은 쪽, 소수점에 이어지는 0은 생략
%c 문자 형식으로 출력
%s 문자열 형식으로 출력

참고로 서실 문자열에 옵션을 추가하여 좀더 다양하게 출력할 수 있습니다. 아래의 예를 참고하여 주십시오.

변환 문자열 출력 의미
printf("%d", 123) 123 표준 출력장치로 출력
printf("%5d", 123) ___123 10진수를 5자리에 맞추어 출력, 123앞에 공백 2개 추가
printf("%-5d", 123) 123__ 10진수를 5자리에 맞추어 출력, 왼쪽 맞춤, 오른쪽에 공백 추가
printf("%f", 1.234567) 1.234567 16진 정수 형식으로 출력
printf("%4f", 1.234567) 1.2346 소쉄 이하 4자리 출력, 반올림
printf("%7.2f", 1.234567) ___1.23 소숫점 포함해서 전체 7자리, 소수점 이하 2자리. 공백 3개가 앞 부분에 추가됩니다.
printf("%s", "forum.falinux.com") forum.falinux.com 지수 형식으로 출력
printf("%20s", "forum.falinux.com") __________forum.falinux.com 자릿수를 맞추기 위해 왼쪽에 공백을 넣어 문자열 출력
printf("%10s", "forum.falinux.com") forum.falinux.com 문자열이 더 길면 그대로 출력
printf("%.10s", "forum.falinux.com") forum.fali 문자열이 더 길면 잘라서 출력
printf("%-20s", "forum.falinux.com") forum.falinux.com________ 문자열을 왼쪽 맟춤으로 하여 오른쪽에 모자르는 자리를 공백으로 메꿈
printf("%12.10s", "forum.falinux.com") __forum.fali 전체 12자리로 10자리만 출력, 모자른 부분은 왼쪽에 공백 추가하여 출력
헤더 stdio.h
형태 int sprintf (const char s, const char * format, ... );
char *s
char *format 서식 문자열

인수


반환

char *s 서식에 맞추어 저장할 메모리 영역의 포인터 
 char *format 서식 문자열 

int  출력된 문자 수를 반환하며 오류가 발생하면 음수를 반환 
 
예제
#include <stdio.h>

int main( void)
{
   char  ptr[1024];
   int   ret;

   ret   = sprintf( ptr, "%d %x %s", 123, 123, "forum.falinux.com");
   printf( "ret=%d ptr=%sn", ret, ptr);

   return 0;
}
]$ ./a.out
ret=24 ptr=123 7b forum.falinux.com
참고


char temp[16] = {0};

sprintf(temp, "TEST : %.*s", 5, "1234567890"); //5 때문에 5글자를 넣는듯 싶음(공간이 남아있음)
printf("%.*s\n
%s\n", strlen(temp), "12345678901234567890", temp);
printf(temp);
결과

123456789012
TEST : 12345 // %.*s 로 자릿수 지정한만큼 출력 strlen(temp),      %s 스트링

TEST : 12345 //이건 당연한거고


asterisk * 를 사용하면 정밀도 조종이 가능함
*s,10 이런식으로 쓰던데 우측정렬기능이 있는듯함


결론 .*s 쓰면 원하는 만큼 문자열에서 빼다 쓸 수 있음
근데 문자열보다 긴 길이일경우 정렬이 깨짐


http://neodreamer.tistory.com/101
참고 여러 옵션 비교

'devel' 카테고리의 다른 글

4bytes data type pointer에서 1byte 씩 접근하기  (0) 2012.06.02
gcc 개인적인 정리  (0) 2012.04.23
Posted by 쵸코케키

블로그 이미지
chocokeki
쵸코케키

공지사항

Yesterday
Today
Total

달력

 « |  » 2024.5
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

최근에 올라온 글

최근에 달린 댓글

글 보관함