본문 바로가기

프로그래밍28

C# 자료형 정수형 (integer) byte[8bit] : 0 ~ 255 sbyte : -128 ~ 127 char[16bit] - U+0000 to U+FFFF short[16bit] : -32,768 ~ 32,767 int[32bit] : -2,147,483,648 ~ 2,147,483,647 long[64bit] : -923,372,036,854,775,808 ~ 923,372,036,854,775,807 ushort : 0 ~ 65,535 uint : 0 ~ 4,294,967,295 ulong : 0 ~ 18,446,744,073,709,551,615 실수형 (floating point) float[32bit] : ±1.5e−45 ~ ±3.4e38 double[64bit] : ±5.0e−324 ~ ±1.7e.. 2015. 10. 23.
cJSON API 저장 * 원문 : http://wiki.openpicus.com/index.php/JSON_Parser JSON APIsThe main data type to use JSON library is struct cJSONThe following tables describe JSON related APIs ParsingFunctionDescription cJSON *cJSON_Parse(const char*value)This function parses a JSON stringconst char *value - pointer to a cJSON string to be parsedReturns cJSON *- pointer to the cJSON parsedNOTE Call cJSON_Delete(cJSON *c) .. 2015. 7. 19.
C# 배열과 n차원 배열 배열의 선언 1 2 3 4 5 6 7 int[] array1; // 선언 후 초기화 n 값은 배열의 크기 정수 array1 = new int[n]{0,1,...,n}; // array1[0] = 1; int[] array2 = new int[n]; int[] array3 = new int[3] {1, 2, 3}; n차원 배열 1 2 3 int[,] array = new int[2, 2] {{1, 2}, {3, 4}}; int[,] array = new int[2, 3, 2] {{{1, 2}, {3, 4}, {5, 6}}, {{1, 2}, {3, 4}, {5, 6}}}; // array1[0, 0] = 1; 2015. 6. 24.
C#, Math MSDN : https://msdn.microsoft.com/ko-kr/library/system.math(v=vs.110).aspx Math.Abs() 숫자의 절대 값을 반환.매개변수는, Double, Int16, Int32, Sbyte, Single 값이 들어 갈 수 있다. Math.Acos() 코사인을 적용했을 때 지정된 숫자가 나오는 각도를 반환 Math.Asin() 사인을 적용했을 때 지정된 숫자가 나오는 각도를 반환 Math.Atan() 탄젠트를 적용했을 때 지정된 숫자가 나오는 각도를 반환 Math.Atan2() 탄젠트를 적용했을 때 지정된 두 숫자의 몫이 나오는 각도를 반환 Math.Cos() 지정된 각도의 코사인을 반환Math.Sin() 지정된 각도의 사인을 반환Math.Tan() 지정된.. 2015. 5. 12.
List<T> List 클래스인덱스로 액세스할 수 있는 강력한 형식의 개체 목록을 나타냅니다. 목록의 검색, 정렬 및 조작에 사용할 수 있는 메서드를 제공합니다.#배열에 다양한 기능을 붙여 주었다고 생각합니다. 리스트의 선언 및 생성1List StrList = new List();cs Capacity 리스트에 할당 된 공간을 확인하거나 설정 할 수 있습니다.1Console.WriteLine("Capacity: {0}", StrList.Capacity);cs Count 리스트에 있는 item의 수를 반환합니다.1Console.WriteLine("Count: {0}", StrList.Count);cs TrimExcess()- item의 수 만큼 Capacity를 조절합니다. Clear()- item을 모두 삭제합니다. 리.. 2015. 4. 19.
C# 웹 파싱 코드 샘플 1234567891011121314151617181920 private void button1_Click(object sender, EventArgs e) { WebRequest request = WebRequest.Create("http://u3d.as/feed/discounted.rss"); WebResponse response = request.GetResponse(); StreamReader stream = new StreamReader(response.GetResponseStream()); // 주소에 있는 텍스트 모두를 긁어 저장 string firstStr = stream.ReadToEnd(); // 파싱할 부분의 시작부분 검색 int index1 = s1.IndexOf("") + 6; //.. 2015. 4. 15.
320x100