CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

global variables

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
mhjccsinfo



Joined: 17 Oct 2011
Posts: 23
Location: Iran-tehran

View user's profile Send private message Send e-mail

global variables
PostPosted: Tue Jul 30, 2013 4:25 pm     Reply with quote

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: 9221
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Jul 30, 2013 5:07 pm     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Tue Jul 30, 2013 7:47 pm     Reply with quote

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

View user's profile Send private message AIM Address

PostPosted: Wed Jul 31, 2013 9:06 am     Reply with quote

do you have global CHAR vars with strings that might
OVERFLOW in runtime ??
mhjccsinfo



Joined: 17 Oct 2011
Posts: 23
Location: Iran-tehran

View user's profile Send private message Send e-mail

PostPosted: Wed Jul 31, 2013 11:26 am     Reply with quote

no
_________________
thanks and hope of success for you
Mohammad_Hosein
temtronic



Joined: 01 Jul 2010
Posts: 9221
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Jul 31, 2013 11:35 am     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Thu Aug 01, 2013 10:39 am     Reply with quote

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 Confused both in software and hardware.
Thanks again for your attention
_________________
thanks and hope of success for you
Mohammad_Hosein
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group