hello! i m using stm32lo73rz in keil micro vresion 5 in hll format. I cant initialize char and int. I m using unsigned char i[]= "giga" but warning will generate that i not decleared. and when compile the programe in docklight giga will not print correctly any other word will come there at rx side when tx something according to code.this is my email abhij752@gmail.com please help me out from this.
This is true, but
unsigned char i[]= "giga";
is valid as a definition.
But C90 requires that all definitions must appear before any executable code in a block.
See, for example: stackoverflow.com/.../iso-c90-forbids-mixed-declarations-and-code-in-c
This is why we need to see an example of how that statement is actually being used in context!
Andrew,
Correct. I was making an assumption based on the error message, since it looks like well formed code.
Well, we're all just guessing until the OP comes back and presents a proper example.
I wonder if that will ever happen - or (s)he is just sitting there waiting for replies to her/his email ... ?
Hey Andrew,
Nah, this is probably one of those "post it out of desperation but as soon as you click post, you realized the mistake, but you forgot to tell the rest of us" kind of posts.
I posted a guess to try to avoid this scenario:
https://xkcd.com/979/