전체 글 (105) 썸네일형 리스트형 Detect Windows Architecture [C++] GetEnvironmentVariable // C++ #include #include #include #include using namespace std; int _tmain(int argc, TCHAR *argv[]){ const DWORD buffSize = 10; LPTSTR buffer1 = new TCHAR[buffSize]; LPTSTR buffer2 = new TCHAR[buffSize]; if (GetEnvironmentVariable(TEXT("PROCESSOR_ARCHITECTURE"), buffer1, buffSize) != 0) cout Detect Windows Architecture [C++] std::getenv // C++ // VC : suppress error messages about obsolete & deprecated functions#define _CRT_SECURE_NO_WARNINGS #include #include using namespace std; int main(int argc, char *argv[]){ if (const char *myArchitecture = getenv("PROCESSOR_ARCHITECTURE")) cout Detect Windows Architecture [C#] Environment.GetEnvironmentVariable // C# using System; namespace Sharp1{ class Program { static void Main(string[] args) { string myArchitecture = Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE", EnvironmentVariableTarget.Machine); if (myArchitecture != null) Console.WriteLine("PROCESSOR_ARCHITECTURE : " + myArchitecture); string myArchiteW6432 = Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432", Environment.. Detect Windows Architecture [C#] Directory.Exists (Not Good Solution) // C# : Not Good Solution using System;using System.IO; namespace Sharp1{ class Program { static void Main(string[] args) { string myArchitecture = Directory.Exists(@"C:\Program Files (x86)") ? "AMD64" : "x86"; Console.WriteLine(myArchitecture); } }} Array [C# Java] 1 Dimensional Array Initialization [C# Java] 1차원 배열의 초기화 방법에 대해서 알아보자. // [C# Java] OK. Since arrays are objects, we need to instantiate them with the new keywordint[] myArray = new int[3];myArray[0] = 10;myArray[1] = 20;myArray[2] = 30; // [C#] OK. We can provide initial values to the array when it is declared by using curly brackets// [Java] Error. We can not define dimension expressions when an array initializer is providedint.. [Operator] Logical & Bitwise Logical Operator [C# C++ Java] 공통 Operator Logical Bitwise ! NOT YES - && AND YES - || OR YES - != XOR YES - Logical Operator [Python]OperatorLogicalBitwisenotNOTYES-andANDYES-orORYES-!=XORYES- Bitwise Operator [C# C++ Java Python] 공통 Operator Logical Bitwise ~ NOT - YES & AND can be used YES | OR can be used YES ^ XOR can be used YES 아래와 같이 Logical XOR Function(Method)을 정의해서 사용해도 된다. // [C#] Lo.. switch [C# C++ Java] fall through 참고 :[C#] switch Statement[C++] switch Statement[Java] switch Statement[C# vs Java] Flow Control switch 구문에서 fall-through 지원 여부를 C# C++ Java 각각에 대해 알아보자. C# C++ Java 공통 코드는 아래와 같다. int number = 2;switch (number){case 1: // print "one" statement for C# C++ Java respectively break;case 2: // print "two" statement for C# C++ Java respectively break;case 3: // print "three" statement for C# C++ Java .. Argument Parameter [Python] Keyword Arguments # Python : Keyword Arguments def work(a: str, b: str): print('a:', a) print('b:', b) work(b='Big', a='Ace') """ Outputa: Aceb: Big""" 이전 1 ··· 5 6 7 8 9 10 11 ··· 14 다음