79627128

Date: 2025-05-18 03:19:51
Score: 1
Natty:
Report link

Thanks a lot for the detailed answers. I got that the the size of the array was initially fixed at a size of [10], and that it couldn't be extended. Guess the way I described it was a bit weird. Also noted my misuse of 'allocate' vs 'assign' re: arrays.

For the sake of messing around with this little program, I just set it at size 10 and was inputting values for num <= 10 that were only ints. I understand now that

printf("&d", arr);

will only display the address of arr, converted to a signed int. Hence why it didn't change before and after going through foo. I changed the code to

printf("array addr: %p", arr);

before and after foo, as well as adding

printf("arr pos %d is %d\n", i, arr[i]);

to foo; also added void as an argument to foo for better form.

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: atsG72