That is the equivalent of:
result = op1 '*' op2
is interpreted by the compiler as a character constant, not as an arithmetic operator.
What data types are, result, op1, and op2 declared with?
Irrelevant what datatypes, this code won't compile.
But it seems that you are trying to directly multiply the character constants of a string with another one, and put the result into 'result'.
If this is the case, then you should revise the topics arithmetic operations, and datatypes + character arrays(pointers) in C++.
Because the fact is that a
is just a pointer to a
, and is not recognised by the compiler as what seems to be their representations, in fact
are just a series of
8bit numbers treated as 'characters' to gain readable output.
If the variables you declared, except
are of an integral or floating point type,
Then you still would have to revise: arithmetic operations, and datatypes.
Because it just doesn't make sense to say: result = op1 42 op2, which is the equivalent of: result = op1 ch op2; (in the case that ch is of type
, which it's name indicates).