IT Community - Software Programming, Web Development and Technical Support

What is the difference between = and == in C?

This is a discussion on What is the difference between = and == in C? within the C and C++ Programming forums, part of the Software Development category; What is the difference between = and == in C?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C and C++ Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-16-2007, 11:24 PM
vadivelanvaidyanathan vadivelanvaidyanathan is offline
D-Web Genius
 
Join Date: Feb 2007
Posts: 803
vadivelanvaidyanathan is on a distinguished road
Wink What is the difference between = and == in C?

What is the difference between = and == in C?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-17-2007, 01:24 AM
prasath prasath is offline
D-Web Sr.Programmer
 
Join Date: Jul 2007
Location: Chennai
Posts: 173
prasath is on a distinguished road
Wink Re: What is the difference between = and == in C?

Hi,
'=' means assignment operator

'==' means relational operator


Example:
-------
void main()
{
int a=5,b=5;
clrscr();
a=b; // here assign the b value to a
Printf("%d",a);
if(a==b) // here check a is equal as b
printf("A is equal b")
getch();
}
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-17-2007, 02:47 AM
Sabari Sabari is offline
D-Web Genius
 
Join Date: Jul 2007
Posts: 1,008
Sabari is on a distinguished road
Angry Re: What is the difference between = and == in C?

hi Vadivelan,

i don't know why you asked this question, basic computer knowledged person also know this difference, because i think most of the computer languages '=' means assignment operator and '==' means relational operator. so please don't waste your time and others too.
__________________
Thanks & Regards
Sabari...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 07:00 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0