Contents

Views 6951 Comment 0
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
자료형 크기 확인하기.. sizeof (ppt. 16)
-------------------------------------------------------------------
#include<stdio .h="">

void main()
{
        printf("n char        : %d byte", sizeof(char));
        printf("n long        : %d byte", sizeof(long));
        printf("n int           : %d byte", sizeof(int));
        printf("n short       : %d byte", sizeof(short));
        printf("n unsigned : %d byte", sizeof(unsigned));
        printf("n float        : %d byte", sizeof(float));
        printf("n double    : %d byte", sizeof(double));
}
-------------------------------------------------------------------



실수형의 표현 (ppt. 9)
-------------------------------------------------------------------
#include<stdio .h="">
#define MAXBIT 31

void main()
{
        int i, cnt=0;
        union _float{
                float flt;
                long lng;
        } temp;

        temp.flt = -0.5;

        for(i=MAXBIT; i&gt;=0; i--){
                (temp.lng&gt;&gt;i)&amp;1 ? putchar('1') : putchar('0');
                if(cnt==0 || cnt==8) putchar(' ');
                else if(cnt&gt;8 &amp;&amp; !(i%8)) putchar(' ');
                cnt++;
        }
}
-------------------------------------------------------------------



메모리 위치 확인 (ppt. 12)
-------------------------------------------------------------------
#include<stdio .h="">

void main()
{
        int in=0x4142;
        char ch1, ch2;

        ch1 = in;
        ch2 = in &gt;&gt; 8;

        printf("addr of in  : %un", &amp;in);
        printf("addr of ch1 : %un", &amp;ch1);
        printf("addr of ch2 : %un", &amp;ch2);

//     printf("nch1=%c, ch2=%cn", ch1, ch2);
}
------------------------------------------------------------------- 
</stdio></stdio></stdio>

?

List of Articles
No. Category Subject Author Date Views
253 Develop [c] 단기과정[01/14] 피보나치, 파스칼.. 파일입출력 file hooni 2003.04.23 7108
252 Develop [c] 단기과정[01/14] 파일 입출력 file hooni 2003.04.23 6859
251 Develop [c] 단기과정[01/10] 과제.. swap(any data, ..) file hooni 2003.04.23 6931
250 Develop [c] 단기과정[01/08] 배열, 포인터 hooni 2003.04.23 7259
249 Develop [c] 단기과정[01/08] 과제.. 파스칼 삼각형 file hooni 2003.04.23 7285
248 Develop [c] 단기과정[01/08] (다차원 + 배열)포인터, void 포인터 hooni 2003.04.23 7792
247 Develop [c] 단기과정[01/07] 제어문, 피보나치수열 hooni 2003.04.23 7432
» Develop [c] 단기과정[01/06] sizeof, 실수표현, 메모리, 연산자 hooni 2003.04.23 6951
245 Develop [c] 다중연결 서버 만들기 #4 - thread 사용 file hooni 2013.04.23 23743
244 Develop [c] 다중연결 서버 만들기 #3 - poll() 사용 file hooni 2013.04.23 6367
243 Develop [c] 다중연결 서버 만들기 #2 - select() 사용 file hooni 2013.04.23 9374
242 Develop [c] 다중연결 서버 만들기 #1 - fork() 사용 file hooni 2013.04.23 12945
Board Pagination Prev 1 ... 45 46 47 48 49 50 51 52 53 54 ... 71 Next
/ 71