유니티로 배우는 c#

자료형

테오구 2021. 9. 30. 13:30
728x90
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class test : MonoBehaviour
{
    int x = 100
    
    // byte 정수 자료형 (0~256) 1바이트
    // sbyte 정수 자료형(-128 ~ 127) - 1바이트
    // short 정수 자료형(-3만 ~ 3만) - 2바이트
    // integer 정수 자료형(-20억 ~ 20억) - 4바이트
    // long 정수 자료형 -8바이트

    float f = 4.00000f;
    double d = 3.001;
    decimal m = 4.00000m;

    // float  실수 자료형
    // double 실수 자료형 float보다 오차 범위가 더 적다
    // decimal 실수 자료형 double보다 오차 범위가 더 적다

    bool a = true;
    string s = 'aasdsadasdasd';
    char c ='a';


    // Start is called before the first frame update
    void Start()//게임이 시작될 때 최초 1회 진행되는 아이
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
728x90

'유니티로 배우는 c#' 카테고리의 다른 글

구조체  (0) 2021.10.10
네임스페이스  (0) 2021.10.10
컬렉션  (0) 2021.10.03
지정자  (0) 2021.09.30
함수  (0) 2021.09.30