Вы находитесь на странице: 1из 1

1.What abstract data type would be used to store a whole number?

Integer
2.Explain how in memory address is used to access an abstract data type that is larger than 1 byte.

Memory address is used toa access an abstract data type when the memory requires a higher byte.

3.What is precision?

precision of a numerical quantity is a measure of the detail in which the quantity is expressed. This is
usually measured in bits, but sometimes in decimal digits. It is related to precision in mathematics,
which describes the number of digits that are used to express a value.

4.How memory is Organized within a computer?

5.What is a user-defined data types?

User-defined types are a significant advantage for any serious programmer, and can even be useful to
less experienced programmers. At their simplest, user-defined types may consist of little more than a
combination of value types that can be used together as a single unit. A perfect example of this might
be a structure containing locale information. This type of structure would need to be passed to any
function that is going to format a number, a date, or a time for presentation to the user and also to
convert such data from the string representation provided by the user to an appropriate value or
object type in the program. Here is what such a structure might look like:
type tLocaleInfo
string sDecimalSep embed
string sThousandsSep embed
string sListSep embed
As can be seen from this example, it would be quite a bit more convenient passing around a single
piece of information that contains all of the things that are important with respect to the locale than to
have to pass each of these pieces of information around separately and to address them and store
them separately as well. The example shown is a very simplistic implementation and does not include
information about formatting dates or times, since these are also considerably more complicated than
mere numeric formatting.

6. What is a Pointer?

a pointer is a programming language data type whose value refers directly to (or "points to") another
value stored elsewhere in the computer memory using its address. For high-level programming
languages, pointers effectively take the place of general purpose registers in low level languages such
as assembly language or machine code—but, in contrast, occupies part of the available memory. A
pointer references a location in memory, and obtaining the value at the location a pointer refers to is
known as dereferencing the pointer. A pointer is a simple, less abstracted implementation of the
more abstracted reference data type (although it is not as directly usable as a C++ reference). Several
languages support some type of pointer, although some are more restricted than others.

7. What happens when you declare an instance of a structure?

Both C and C++ allow integer members to be stored into memory spaces smaller
than the compiler would ordinarily allow. These space-saving structure members
are called bit fields, and their width in bits can be explicitly declared.

Вам также может понравиться