Data typesA variable is defined using one of the following data types. intint variables store an integer number ranging from -2,147,483,648 to +2,147,483,647. int Count; Count = 7; floatfloat variables store a floating point number ranging from 1.175494351 E–38 to 3.402823466 E+38. float HourlyRate; HourlyRate = 17.95; doubledouble variables store a floating point number ranging from 2.2250738585072014 E–308 to 1.7976931348623158 E+308. double NumberOfStars; NumberOfStars = 1.e+21; charchar variables store a single character. Here's the Wikipedia entry for the ASCII character set. char OneCharacterOnly; OneCharacterOnly = 'c'; pointerpointer variables store a single memory address in conjunction with the type of data found at the memory address. A pointer is indicated by placing an * before the variable name. int *pInteger; char *pCharacter; arrayarray variables store a list of one of the above data types. An array is indicated by placing [n] after the variable name, where n is the size of the array. int IntegerArray[5]; char CharacterArray[7]; stringC does not have a string data type. Top |
|