20101015 - 금 - 변수
변수
* 1Bite - 8bit = 2(8승) = 256의 셀
- 대문자-소문자 관계 1KB (Bite), 1kb (1000bit)
- char, int, short, long, float, double
(데이타 크기에 따라 메모리 공간 사용..)
* 코딩 연습
#include <stdio.h>
void main()
{
printf(" 문자열 출력 : [%-20s] \n", "유비쿼터스 2");
printf(" 문자열 출력 : [%20s] \n", "전자 기술과");
printf(" 문자 출력 : [%10c] \n", 'a');
printf(" 문자 출력 : [%-10c] \n", 'a');
printf(" 문자 정수값 출력 : [%-10d] \n", 'a');
printf(" 왼쪽 정렬 : [%-10d] \n", 1234);
printf(" 오른쪽 정렬 : [%10d] \n", 1234);
printf(" 0삽입 출력 : [%010d] \n", 1234);
printf(" 음수의 0삽입 : [%010d] \n", -1234);
printf(" 부동소수점 출력 : [%8.2f] \n", 123.4567);
printf(" 부동소수점 출력 : [%-8.2f] \n", 123.4567);
printf(" 부동소수점 출력 : [%10.2f] \n", 0.0012345);
printf(" 뭐 라 카 노 : [%30s] \n", " 시방새야 ");
}
* 변수에 관하여~
- %d 10진수 , %o 8진수 , %x 16진수 , %c 문자 , %s 문자열 , %f 실수
- ASCII 7bit = 2^7 = 128
- BBCAII 8bit = 2^8 = 256
- 아스키 ASCII
* 코딩연습2
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int ASCII;
while(1)
{
ASCII = _getch();
printf(" 입력된 key의 ASCII : %d \n", ASCII );
}
return 0;
}
'Edu > 유비쿼터스설비제어과정' 카테고리의 다른 글
20101020 - 수 - Capture CIS 도면 한장 (0) | 2010.10.20 |
---|---|
21011019 - Proteus, Capture CIS, Layout Plus (1) | 2010.10.19 |
20101019 - 화 - CDS (0) | 2010.10.19 |
20101018 - 월 - Proteus 7.5 sp3 pro, 설치 및 연습 (0) | 2010.10.18 |
20101015 - 금 - 코딩,변수, VC++ .c (0) | 2010.10.15 |
20101014 - VC++ 간단한코딩연습 캡처 - .c .dsp .dsw .ncb .opt .plg (0) | 2010.10.14 |
20101014 - 목 - VC++ (0) | 2010.10.14 |
20101013 - 수 - OrCAD, Gate (0) | 2010.10.13 |
20101013 - 수 - Gate (0) | 2010.10.13 |
20101012 - Or-CAD, Capacitor (0) | 2010.10.12 |