
Patrick B. answered 10/03/20
Math and computer tutor/teacher
the function returns an ADDRESS of an integer...
So yes, it is returning an ADDRESS of 210...
Xiana Z.
asked 10/03/20#include <stdio.h>
#include <stdlib.h>
int *get_val(int y) {
int x = 200; x += y;
return x; }
int main()
{ int p, y = 10;
p = get_val(y);
printf("%d\n", p);
exit(0); }
After compiling the following code I got .
main.c:17:9: warning: return makes pointer from integer without a cast
main.c:25:4: warning: assignment makes integer from pointer without a cast
but it still showed the correct ANSWER WHICH IS 210 . (I did run it in a c language based compiler)
Patrick B. answered 10/03/20
Math and computer tutor/teacher
the function returns an ADDRESS of an integer...
So yes, it is returning an ADDRESS of 210...
Get a free answer to a quick problem.
Most questions answered within 4 hours.
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.