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

(i.e. int num;) then assign it a value later in a function? when i say "can't" i mean i get memory errors during compile time.

i am learning how to develop firmware on an embedded platform, i know it has to do with memory, but i don't know the details. if anyone can give me an overview of this problem and why it occurs, i would appreciate it.

thanks!

2007-03-15 19:34:22 · 3 answers · asked by thangtu 2 in Computers & Internet Programming & Design

i am using keil compiler 6.03

2007-03-15 19:42:28 · update #1

3 answers

thats just the way it works with embedded micro's and Keil. when you declare a variable, all the compiler is doing is assigning memory space for it. you then have to initialize it. Its really just the way the compiler works. it "could" initialize it when you declare it, but it would have to add the code to do that, and in the embedded world, you really dont want the compiler adding code because it might not add it where you want it (just my opinion, and experience).

2007-03-16 02:25:01 · answer #1 · answered by justme 7 · 0 0

An ansi compiler will allow you to do that. Which compiler are you using?

2007-03-15 19:40:58 · answer #2 · answered by BigRez 6 · 0 0

it is compiler dependent which compiler are you using

2007-03-15 19:39:14 · answer #3 · answered by Anonymous · 0 0

fedest.com, questions and answers