Skip to content

C#: XOR operation got error Cannot implicitly convert type int to byte.

How to solve error ” error CS0266: Cannot implicitly convert type ‘int’ to ‘byte’. An explicit conversion exists (are you missing a cast?)” in C#: XOR operation? Just pust cast as byte to final operation


  1. before:  output[i] = ((oper1[j] ^ oper2[j]) ^ oper3[i]);
  2. after:  output[i] = (byte)((oper1[j] ^ oper2[j]) ^ oper3[i]);

C#: Compile app in x64 (64bit) and linking with x86 (32bit) DLL

When compile a C# app and linking with x86 (32bit) DLL, got this error: “That error is the Win32 error ERROR_BAD_EXE_FORMAT” or similar error. This occur when your DLL is x86 (32bit) platform and your is x64 (64bit) platform. To solve this problem, add platform switch at csc.exe command:

Type this at your command line:
csc /platform:x86 HelloWorld.cs

This command save me when I got that problem. I was working on app development for RFID / smartcard project. The RFID is ACR120U. The reader drivers (DLL) was compiled using  x86 platform but my laptop is x64 platform. I dont want to use new reader because my organization got too many stock for this reader (ACR120U).

What are the C# equivalent of these C datatype?

signed char c; -> SByte c;
unsigned char b; -> Byte b;
signed short s; -> Int16 s;
unsigned short w; -> UInt16 w;
signed long l; -> Int32 l;
unsigned long u; -> UInt32 u;
float f; -> Single f; (though ‘float’ still works)
double *d; -> Double d; (was this meant to be a pointer???)
char *p; -> String s; (assuming its a string here, in the marshaling you can tell it whether it is ASCII or wide char format)

Create opencart module

Today i want to develop opencart module. My goal is provide product option with quantity…first step is learn how vurrent opencart catalog working

Kuih tradisional – limas (limaih)

Hari ini ibuku bercerita tentang cara membuat temalung limas (limaih). Kemahiran untuk membuat temlaung limas bukan lah perkara yang mudah.

Create first Laravel application

How to create your first Laravel application in Windows 7 or 8:

  1. Install Composer
    1. Enable openssl in PHP
  2. Install laravel using Composer
    1. Open command prompt
    2. Type composer global require “laravel/installer=~1.1”
  3. Create first application – l5todo
    1. laravel new l5todo
  4. Error:
    1. Parse error: syntax error, unexpected ‘class’ (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or ‘{‘ or ‘$’ on linux server



Install composer on Windows 10

How to install composer on Windows 10?


  1. Download and run Composer-Setup.exe. It will install the latest Composer version and set up your PATH so that you can just call composer from any directory in your command line.
  2. Run command prompt
  3. Change directory to xampp folder
  4. install composer: composer global require “laravel/installer=~1.1”
  5. Set laravel binary / bat file in PATH environment. Laravel binary / bat file location: C:\Users\<computer_name>\AppData\Roaming\Composer\vendor\bin