What is the difference between = and == in C?
Answers were Sorted based on User's Feedback
Answer / aman
* First of all = is a assignment operator and == is a comparision operator.
* = operator is used to assign value to a variable and == operator is used to compare two variable or constants.
* The left side of = operator can not be a constant, while for == operator both sides can be operator.
http://www.cplusplus.com/forum/general/18183/
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / datta khilari
= operator is assignment operator
== is operator comparision two values
| Is This Answer Correct ? | 4 Yes | 2 No |
Answer / kiranmai
= is used to assign the value it is called assignment operator where as
== is used to compare whether the left side and right side values are equal or not
| Is This Answer Correct ? | 0 Yes | 0 No |
'=' assigns a value to a variable whereas '==' checks whether two values are equal or not
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / nashiinformaticssolutions
=: Assignment operator (e.g., x = 10).
==: Equality comparison operator (e.g., if (x == 10)).
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / nashiinformaticssolutions
== checks equality; = assigns values.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / glibwaresoftsolutions
=: Assignment operator (e.g., x = 10).
==: Equality comparison operator (e.g., if (x == 10)).
| Is This Answer Correct ? | 0 Yes | 0 No |
=: Assignment operator (e.g., x = 10).
==: Equality comparison operator (e.g., if (x == 10)).
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / varsha vilas kalebag
== assignment operator
= equal to
| Is This Answer Correct ? | 8 Yes | 17 No |
Is c++ map a hash table?
What is static function? Explain with an example
can any one help to find a specific string between html tags which is changed to a sting.. weather.html looks (for location) is <location>somewhere</location> #include <iostream> #include <fstream> #include <string> using namespace std; string find_field(string myPage,string); int main (void) { string page, line, location, temperature; ifstream inputFile("weather.xml"); while(getline(inputFile, line)) { page.append(line); line.erase(); } // Now page is a string that contains the whole xml page // Here you need to write something that finds and // extracts location and temperature from the XML // data in the string page and stores them in // the strings location and temperature respectively location=find_field(page,"location"); temperature=find_field(page,"temp_c"); cout << "Location: "<<location << endl; cout << "Temperature: " << temperature << endl; system("pause"); } string find_field(string myPage,string find_string){ int temp=myPage.find(find_string); if(temp!=string::npos) { cout << "Match found at " << temp << endl; } return "found?"; } ///
Write a function that swaps the values of two integers, using int* as the argument type?
What is the operator in c++?
What are the different types of polymorphism?
What do you mean by abstraction. Explain your answer?
How to give an alternate name to a namespace?
What is name hiding in c++?
Explain the properties and principles of oop.
What are activex and ole?
What are the conditions that have to be met for a condition to be an invariant of the class?