'variable'에 해당되는 글 1건

  1. 2009.01.24 [C/C++] What is 'variable'??

[C/C++] What is 'variable'??

Language/C&C++ 2009.01.24 23:43
[[ blog 이사 과정에서 정확한 posting날짜가 분실됨. 년도와 분기 정도는 맞지 않을까? ]]

What is variable in C? Let's think about this deeply.

The variable consists of type and name.
Then, what is 'type'? and what is name?
'type' is "What the memory value means"; Way of interpreting memory.
'name' is alias of memory address.

Can you understand?
We can know that 4-byte-memory-value from address '&a' represents 'signed integer value' from C code "int a;".

Following example(ARM assembly and C codes) shows this explicitly.

// asm.s
EXPORT my_symbol
CODE32
my_symbol
DCD 0x73d71034

------------

// symbol.c
extern char* my_symbol;
int data = (int)my_symbol;
신고
tags : ,
Trackback 0 : Comment 0

티스토리 툴바