Q:

What does the following program do?

0

What does the following program do?

int i = 42;
int *p1 = &i;
*p1 = *p1 * *p1;

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include <iostream>

int main() {
  int i = 42;
  int *p1 = &i;
  *p1 = *p1 * *p1;  // i = i * i
  std::cout << i << std::endl;

  return 0;
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now