View previous topic :: View next topic |
Author |
Message |
mhjccsinfo
Joined: 17 Oct 2011 Posts: 23 Location: Iran-tehran
|
global variables |
Posted: Tue Jul 30, 2013 4:25 pm |
|
|
hi all
is it possible to give initial value to the global variables in their declarations/definitions ?
for example:
unsigned int16 minimum=12;
thanks _________________ thanks and hope of success for you
Mohammad_Hosein |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9246 Location: Greensville,Ontario
|
|
Posted: Tue Jul 30, 2013 5:07 pm |
|
|
yes...
easy to try ...
create a small program and then printout the listing to see how the compiler does it!
hth
jay |
|
|
mhjccsinfo
Joined: 17 Oct 2011 Posts: 23 Location: Iran-tehran
|
|
Posted: Tue Jul 30, 2013 7:47 pm |
|
|
Thanks for your reply.
I have tested it before and it worked for me. But I have some halts in program execution and I guess this could be related. Also halts decreased when I delete these values. So as you said it's from somewhere else.
Thanks _________________ thanks and hope of success for you
Mohammad_Hosein |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Wed Jul 31, 2013 9:06 am |
|
|
do you have global CHAR vars with strings that might
OVERFLOW in runtime ?? |
|
|
mhjccsinfo
Joined: 17 Oct 2011 Posts: 23 Location: Iran-tehran
|
|
Posted: Wed Jul 31, 2013 11:26 am |
|
|
no _________________ thanks and hope of success for you
Mohammad_Hosein |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9246 Location: Greensville,Ontario
|
|
Posted: Wed Jul 31, 2013 11:35 am |
|
|
If you can, post a small program that has the problem. Might be something 'silly' that you can't see because you've stared at it foe hours !
Also post compiler version.
hth
jay |
|
|
mhjccsinfo
Joined: 17 Oct 2011 Posts: 23 Location: Iran-tehran
|
|
Posted: Thu Aug 01, 2013 10:39 am |
|
|
temtronic wrote: | If you can, post a small program that has the problem. Might be something 'silly' that you can't see because you've stared at it foe hours !
Also post compiler version.
hth
jay |
Thank you temtronic. My problem solved. I've changed my program structure and now it's working well. But i'm always surrounded by these "silly" matters both in software and hardware.
Thanks again for your attention _________________ thanks and hope of success for you
Mohammad_Hosein |
|
|
|