pointer variable cannot be multiplied by constant Int*ptr;ptr=ptr*9;//illegal
Answers
Answered by
0
A point varible can be multiplied by constant, but you just have to know the correct way.
int y = 2;
int *ptr = &y;
cout << *ptr * 2 ;
Output: 4
Similar questions
Music,
5 months ago
Math,
5 months ago
Social Sciences,
5 months ago
Psychology,
11 months ago
Math,
11 months ago
Math,
1 year ago