When checking if two primitive types are equal, you need to use “==” instead of “=”
e.g, change your if statements from
if ( r = 1 )
to
if (r == 1)
More Related Contents:
- Insertion sort stops working after million input
- How to find out how many bits are set (equal 1) in the product of two integers [closed]
- Program stopped working, when tried to run
- Absolute Distinct Numbers
- C++ throwing exception in recursive algorithm
- How to use Quick Sort to sort an array of strings
- How to get the maximum number after erasing n digits from the number [closed]
- Calculating pow(a,b) mod n
- What is the efficient way to count set bits at a position or lower?
- How to find which elements are in the bag, using Knapsack Algorithm [and not only the bag’s value]?
- Lock-free Progress Guarantees in a circular buffer queue
- Getting the actual length of a UTF-8 encoded std::string?
- Fast String Hashing Algorithm with low collision rates with 32 bit integer [closed]
- Emulate “double” using 2 “float”s
- Algorithm for finding the smallest power of two that’s greater or equal to a given value [duplicate]
- How can I find the actual path found by BFS?
- Need for predictable random generator
- Splitting a string by a character
- How can I sort a std::map first by value, then by key?
- what is the difference between set and unordered_set in C++?
- Similar String algorithm
- Calculating the Amount of Combinations
- Better shading on BW display while rendering filled surfaces
- How can I sort an STL map by value?
- Algorithm to add or subtract days from a date?
- Creating N nested for-loops
- Is it more efficient to copy a vector by reserving and copying, or by creating and swapping? [duplicate]
- Why there is no std::copy_if algorithm?
- priority queue with limited space: looking for a good algorithm
- How can I test whether a number is a power of 2?