Windows Programming, C.-S. Shieh, KUAS EC, Chapter 3 Operators and Expressions
Windows Programming, C.-S. Shieh, KUAS EC, Naming Rules for Identifiers Consist of A-Z, a-z, 0-9, and _. First character must not be 0-9. No confliction with reserved words. Case sensitive. No Chinese.
Windows Programming, C.-S. Shieh, KUAS EC, Basic Data Types C++ Builder Basic Data Types –char, int, long, float, double –bool: true or false AnsiString Type –There is no string type in C, only array of char. –AnsiString type makes string manipulation easy. AnsiString x,y,z; x=”Hello”;y=”world!”; z=x+”, ”+y;
Windows Programming, C.-S. Shieh, KUAS EC, C++ Operators Arithmetic: +,-,*,/,% Assignment: =,+=,-=,*=,/=,%=,&=,|= Relational: ==,!=,, = Logical: &&,||,! Bit-wise logic operator: &,|,~ Increment and decrement: ++,--
Windows Programming, C.-S. Shieh, KUAS EC, Data Representations ASCII –American Standard Code for Information Interchange –One byte per character Chinese Big-5 –Two byte per Chinese character
Windows Programming, C.-S. Shieh, KUAS EC, Number Systems Position-Weighted System –Decimal –Binary (10.101) 2 =2.625 –Hexadecimal (1A.2B) 16 =