انت هنا الان : شبكة جامعة بابل > موقع الكلية > نظام التعليم الالكتروني > مشاهدة المحاضرة
الكلية كلية العلوم للبنات
القسم قسم الحاسبات
المرحلة 1
أستاذ المادة هديل قاسم غني
01/01/2017 22:05:55
1 character set: c++ has the letters and digits, as show below: uppercase: a, b, c, . . ., z lowercase: a, b, c, . . ., z digits: 0, 1, 2, . . .,9 special characters: all characters other than listed treated as special characters for example: + - * / ^ ( [ { } ] ) < = > , (comma) “ (double conations) . (dot) : (colon) (semicolon) (blank space) in c++ language, upper case and lower case letters are distinct and hence there are 52 letters in all. for example bag is different from bag which is different from bag. 2 identifiers: an identifier is a name given to some program entity, such as variable, constant, array, function, structure, or class. an identifier is a sequence of alphanumeric (alphabetic and numeric) characters, the first of which must be a letter, and can’t contain spaces. the length of an identifier is machine dependent. c++ allows identifiers of up to 127 characters. a variable should not begin with a digit. c++ does not set a maximum length for an identifier. some examples of valid identifiers are as follows: my_name (7 char.) i (1 char.) b (1 char.) lesson three lecture 3 examples of invalid identifiers are: 3ab a()test ros sal 3 keywords: the keywords are also identifiers but cannot be user defined, since they are reserved words. all the keywords should be in lower case letters. reserved words cannot be used as variable names or constant. the following words are reserved for use as keywords: some of c++ language reserved words: break case char cin cout deleting double else enum false float for goto if int long main private public short sizeof switch true union void 4 constants: there are three types of constants: string constants, numeric constants, and character constants. 1. string constants: a string constants are a sequence of alphanumeric characters enclosed in double quotation marks whose maximum length is 255 characters. in the following are examples of valid string constants: (“the result=”, “rs 2000.00”, “this is test program”). the invalid string constants are like: (race, “my name, ‘this’). 2. numeric constants: numeric constants are positive or negative numbers. there are four types of numeric constants: integer, floating point, hexadecimal, and octal. lesson three (a) integer constants: do not contain decimal points: int x,y shortint x,y longint x,y ? integer data: size (16 or 32) fill in -215 to 215-1 for 16 bit and -231 to 231-1 for 32 bit. ? short integer: fill in -215 to 215-1. ? long integer: fill in -231 to 231-1. ? unsigned: fill in (0 to 65635) for 16 bit and (0 to 4,294, 967, 295) for 32 bit. (b) floating point constants: positive or negative numbers are represented in exponential form. the floating point constant consists of an optionally (signed) integer or fixed point number (the mantissa) followed by the letter e and e and an optionally signed integer (the exponent). ex. (9010e10, 77.11e-11). ? float 4 bytes. ? double 8 bytes. ? long double 12 or 16. (c) hexadecimal constants: hexadecimal numbers are integer numbers of base 16 and their digits are 0 to 9 and a to f. integer integer short integer (short) long integer (long) float single precision (float) double precision (double) long double hexa short hexadecimal long hexadecimal unsigned unsigned char unsigned integer unsigned short integer unsigned long integer octal short octal long octal lesson three (d) octal constants: octal numbers are numbers of base 8 and their digits are 0 to 7.
المادة المعروضة اعلاه هي مدخل الى المحاضرة المرفوعة بواسطة استاذ(ة) المادة . وقد تبدو لك غير متكاملة . حيث يضع استاذ المادة في بعض الاحيان فقط الجزء الاول من المحاضرة من اجل الاطلاع على ما ستقوم بتحميله لاحقا . في نظام التعليم الالكتروني نوفر هذه الخدمة لكي نبقيك على اطلاع حول محتوى الملف الذي ستقوم بتحميله .
|