[프로그래밍]2진법 10진법 변환기
- 최초 등록일
- 2005.12.22
- 최종 저작일
- 2005.12
- 압축파일
- 가격 1,000원
소개글
10진법과 2진법 사이의 변환을 수행하는
C 프로그램 입니다.
컴파일 실행환경
Visual studio 6.0
본문내용
//2진수와 10진수 사이의 변환 프로그램
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
//입력의 type에 대한 기호상수 지정
#define BINARY_POSITIVE 20 // 2진 양수일 경우
#define BINARY_NEGATIVE 21 // 2진 음수일 경우
#define DECIMAL_POSITIVE 10 //10진 양수일 경우
#define DECIMAL_NEGATIVE 11 //20진 음수일 경우
#define CONTINUE 1
#define DISCONTINUE 0
//기타 기호상수 지정
#define ERROR 1 //에러를 표시
#define ERRORNO 0 //에러 없음을 표시
#define BINARYMAX 33 //2진수 입력범위지정-널포함 33문자
#define LENMAX 255 //일반 배열 크기
//입력 type과 ERROR를 위한 전역변수
int ERRORCODE;
int NUMMODE;
int CONTINSTATE=CONTINUE;
//입력된 숫자의 type을 결정하는 함수
int CheckMode(char *str,int *count);
//값을 새로운 배열로 읽어 들이는 함수
int GetValue(char *str,char *strnew,int count);
//자리넘침이나 정수범위를 확인하는 함수
int CheckOverflow(char *strnew);
//2진 음수형태를 변환하는 함수
char *binarynegative(char *strnew);
//2진 양수형태를 변환하는 함수
char *binarypositive(char *strnew);
//10진 음수형태를 변환하는 함수
char *decimalpositive(char *strnew);
//10진 양수형태를 변환하는 함수
char *decimalnegative(char *strnew);
//type변환 함수를 위한 함수의 포인터 선언
char *(*changenumber)(char *strnew);
압축파일 내 파일목록
컴퓨터2.doc
COMP_1STHW.doc
realchange.c
참고 자료
없음