English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

In other words where does the computer stores the data type of a variable?

2007-04-02 08:15:55 · 3 answers · asked by mustermark 1 in Computers & Internet Programming & Design

3 answers

A computer does not store data type

the data read at a memory address is binary (1's and 0's)

It's the compiler that simplifies things for you. The compiler needs to know the data type so that it knows how much space in memory to reserve.

2007-04-02 08:21:52 · answer #1 · answered by Anonymous · 2 1

The compiler tells it what size of memory it is dealing with, specified by the type of the value it is accessing. In the case of an integer, 4 bytes, in the case of a character it's 1. This is why C / C++ require you to specify the variable type.

2007-04-02 15:36:26 · answer #2 · answered by Pfo 7 · 0 0

The computer doesn't know. It's some program that you write, that determines how you want to treat some raw series, and set (like, say, 8 or 16, or 32, or 40 or some other number) of bits.

2007-04-02 15:26:53 · answer #3 · answered by fjpoblam 7 · 1 0

fedest.com, questions and answers