+ 1
C++
int a=4,b=2,c; int *p; p=&a; c=b*p; // -> c=? edited
5 ответов
+ 5
to fix the compile error on line 4, try instead :
b = *p;
( what you wrote b*=p is a multiplication between an int and a ptr, equivalent to
b = b * p
which fails.
)
See sample code below:
https://code.sololearn.com/cIeqM1m9UKNt/?ref=app
+ 3
compilation error
+ 1
This is just an idea, not a complete program should still have errors occur
+ 1
you'll get a compilation error, because you intended to multiply an int type variable with a pointer that point to an int(int*)