Questions tagged [operands]

Operands are values acted upon by an operator, method, or other functional entity.

Operands differ from parameters in that they are the real values used or altered by a function, while the parameters are the named, abstract inputs used to define the function.

313 questions
-1
votes
1 answer

“Invalid operands to binary expressions” Error

I keep getting this error: Invalid operands to binary expressions ('struct node'and 'int') on two lines that I've marked below with ** in the function "reachR". Whats wrong and how can I fix it? The code is for a data structure…
Marcos Guimaraes
  • 1,243
  • 4
  • 27
  • 50
-1
votes
1 answer

Bad operand types for binary operator '>'

I get an error on this line of my code. if (age < 17) { System.out.println("You are a adult"); The error is Bad operand types for binary operator '>' This is my full code package transition.work; import java.io.BufferedReader; import…
-1
votes
2 answers

Invalid operands of types 'double' and 'double'

I'm in a beginner's c++ course. Currently we are working on a project that will count the number a times each character of the alphabet is in a phrase that the user inputs. The program will output everything onto a table (left to right: Letter | #…
Tony
  • 137
  • 1
  • 3
  • 11
-1
votes
3 answers

Suppose "value" is any integer: is value++ the direct equivalent to value = value + 1;?

I understand that the values of the two would be the same (say 3 to 4). However, does the computer see the two as the same, and would they both be considered expressions? Thanks in advance!
AlteredCow
  • 9
  • 1
  • 5
-1
votes
2 answers

java operators and operands

consider int a =10; c = a/a; //c becomes 1. c= a* + a/a ; //c becomes 1. c= 5+ a* + a/a ; //c becomes 15. c = ++a + a++ - --a - a-- + a * + a/a ; //c becomes 10. Can someone please tell me how the…
-1
votes
1 answer

IntelliSense: no operator "+" matches these operands

Hi there, I am new to C++ and I got this error. IntelliSense: no operator "+" matches these operands The problematic line of code is: cout << i << "\t" << temp->VehicleNo + "\n"; Link to picture showing context of…
Lawrence Wong
  • 1,129
  • 4
  • 24
  • 40
-1
votes
3 answers

php synatax what do these do? '^' and '|'

IN php, how do the following operands work? ^ | e.g. $a = 11; $b = 7; echo $a ^ $b; outputs 12 and $a = 11; $b = 7; echo $a | $b; outputs 15 Im not sure why in each case. Can someone please shed some light?
Kevin Bradshaw
  • 6,327
  • 13
  • 55
  • 78
-1
votes
3 answers

convert bool to int?

I have this code, and I can't see why I cannot use the operator || in this example. "Operator '||' cannot be applied to operands of type 'bool' and 'int'" Am I missing something? where is this boolean? int i = 1; if ( i…
LaughingMan
  • 640
  • 1
  • 9
  • 18
-2
votes
2 answers

How do I fix Invalid Operands To Binary + (have 'struck _' and 'struct _ ')

It displays [Error] invalid operands to binary + (have 'struct bus' and 'struct bus') enter code here struct bus {int bus; }b1,b2,b3; int main() { printf("Enter bus fair 1"); scanf("%d", &b1.bus); printf("Enter bus fair 2"); scanf("%d",…
-2
votes
1 answer

Incompatible Types and Bad Operand Type Error for LinkedList

Hi for my project I'm trying to remove all occurences of the item and return the number of items removed. All subsequent items are moved to the left and if the item is not found, this method will return 0. Here is my code : public class…
-2
votes
1 answer

warning: operand types are incompatible ("int" and "void *")

I am using a pgcc compiler to compile the following piece of code. I keep getting this warning and I am not sure what is wrong with it. Here is the code, followed by the warning: #include #include #include #ifdef…
-2
votes
2 answers

bad operand types for binary operator "==" in java

i try to see if the char of a string == "1" but it shows error as bad operand types for binary operator. import java.util.Scanner; public class Q3 { public static void main (String[] args){ Scanner scan = new Scanner(System.in); …
-2
votes
1 answer

Can I use operator in variable

Can I write code like below in php? $operator = ">=90"; $val = 100; if($val.$operator){ echo "Correct!"; }
-2
votes
1 answer

unsupported operand type(s) for +: 'pygame.math.Vector2' and 'int'

I don't know what's going on and I can't find anyone else with the same issue. Here is my code: import pygame import math import random import os SWIDTH = 800 SHEIGHT = 600 vec = pygame.math.Vector2 FRI = 0.3 ACC = 1 this is the error File…
-2
votes
1 answer

Assign comparison operator to variable?

Is it possible to assign < to a variable, let's say b ? For example: b = < . Edit: My plan is the following: a < b < c < d . I want add the "compares" to a permutation. I know that I can add a b c d to a permutation but I have to change the < too.…
Dan Ru
  • 7
  • 5
1 2 3
20
21