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 support@ccsinfo.com

probleme void defilement

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



Joined: 10 Apr 2010
Posts: 5

View user's profile Send private message

probleme void defilement
PostPosted: Sat May 29, 2010 2:05 am     Reply with quote

when i compile this warning apper to me "line 535 code has no effect "
i==i-30 has no effect
i need a solution

THE PROGRAMM

#include <16F877A.h>
#fuses XT, NOLVP, NOWDT
#use delay(clock=4000000)

void defilement(int i)
{
if(i>29)
{
i==i-30;
mini_main(i);
}


}

void main()
{
.
.

}

++++++++++++++++++++++
576 line program chopped down
to needed part.

-- Forum moderator
++++++++++++++++++++++


Last edited by ahmeddragonbleu on Sat May 29, 2010 7:52 am; edited 1 time in total
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Sat May 29, 2010 3:40 am     Reply with quote

Post small programs. 95% of the posted code has nothing to do with the problem.

Quote:
i=i-30 has no effect

Code:
i==i-30;
Spot the difference in these two lines...
What did you intend and what did you actually write?
ahmeddragonbleu



Joined: 10 Apr 2010
Posts: 5

View user's profile Send private message

PostPosted: Sat May 29, 2010 7:54 am     Reply with quote

when i compile this warning appear to me "line 535 code has no effect "
i==i-30 has no effect
i need a solution

void defilement(int i)
{
if(i>29)
{
i==i-30;
mini_main(i);
}
Ttelmah



Joined: 11 Mar 2010
Posts: 19358

View user's profile Send private message

PostPosted: Sat May 29, 2010 8:37 am     Reply with quote

The answer has already been pointed out...
The statement :

i==i-30;

says 'test if i equals i-30', then as written, the result of the test is thrown away.

It has no effect. The compiler is telling you _exactly_ what is going on...

Best Wishes
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Sun May 30, 2010 3:37 am     Reply with quote

As an answer to your question in: http://www.ccsinfo.com/forum/viewtopic.php?p=133077
Check your study book on the C language and look up the difference between the '=' and '==' operators.
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