반응형

//**********************************************************************
// 변수 !!
//**********************************************************************
// ->>>>>>>>>>메모리 공간에 대한 이름!
//**********************************************************************
// 메모리 !!
//**********************************************************************
// 하나의 프로그램이 실행되고 있는 공간!!
//**********************************************************************
// 데이타의 타입 (변수의 종류)
//**********************************************************************
/* 32 비트
// - 숫자
  -정수
   - int 4byte
   - long 4byte
   - short 2byte
  -실수
   - float 4byte  // 메모리를 절약!!!
   - double 8byte //

   
   signed : 부호가 있는!!
   unsigned : 부호가 없는 !!
   //unsigned double : 4 byte
// - 문자
  -문자
   - char 1byte

  -문자열(기본 타입이 없다.)
   - char 배열
   - char * 사용!!
// - 복합 ---->>>여러개가 합쳐진 형태 !!
  - 구조체
  struct Student
  {
       char name[20];//이름
       int age;//나이
       char school[20];//학교
       int sellnum;//전화번호
       int stu_number;//학번
  }
  - 배열
   -->> 동일한 타입들의 모임, 집합
   -->> 동일한 타입의 변수들이 연속된 메모리 공간에 모여 있는 집합
   int p[5];
   100 104 108 112 116
   [ ] [ ] [ ] [ ] [ ]
  - 열거형
//**********************************************************************
*/

#include <stdio.h>

void main()
{

     char name[20]="Tom Jang \n";

     printf(name);
 /*
     int a =1;

     unsigned int aa =-1;
     aa=1;

     unsigned double Score;

 */
 //sizeof 연산자 : 타입의 크기를 가져온다!!

     printf("***변수***\n");

     printf("Int : %d \n", sizeof(int));
     printf("long : %d \n", sizeof(long));
     printf("short : %d \n", sizeof(short));
     printf("float : %d \n", sizeof(float));
     printf("double : %d \n", sizeof(double));
     printf("char : %d \n", sizeof(char));

}

From SM Bit

반응형