목록프로그래밍/C# (11)
게임 프로그래밍
using System.Collections; using System.Collections.Generic; using UnityEngine; using System.IO; using System.Runtime.Serialization.Formatters.Binary; using System.Runtime.Serialization; using System.Reflection; using System; public class SerializeObject { public static void Serialize(Object dictionary, Stream stream) { try // try to serialize the collection to a file { using (stream) { // create..
&& 연산자는 알다 시피 조건이 둘 다 true 일때 true를 반환하는 연산자이다. 인터넷에서 어디 선가 본 바로 && 연산자는 앞에 조건이 false일 경우 뒤에 조건은 검사하지 않는다고 한다.(언어 마다 다를 수 있다) 그래서 만약 앞에 조건이 false일때 뒤에 조건이 들어가지 않아야 하는 경우 &&연선자를 써주면 된다. ex) if( x > -1 && temp[x] ) // x가 -1이면 잘못된 배열에 들어가 오류가 발생함. 하지만 && 연산자로 -1일때 false이므로 -1로 배열을 참조 하지 않음.
문자열 변수를 연결 할려면은 +, 또는 += String.Concat, String.Format, stringBuilder.Append를 이용하여 사용 할 수있다. 1. +, += ------------------------------------------------- string Text = "Test1" + "Test2"; Console.WriteLine(text); ------------------------------------------------- string Text1 = "Test1"; string Text2 = "Test2"; Text += Text2;Console.WriteLine(text); ------------------------------------------------- +,..