Value and type of last evaluated expression: Address of array element: Address of array elementx: (none)
Your browser does not support the canvas element
which will make some the features unavailable.
If you are using Internet Explorer within the University of Exeter
try going to the Settings menu (probably the gear shape at the top right
of this page),
selecting "Compatibility View settings",
unchecking "Display intranet sites in Compatibility View"
and reloading this page.
Code
Header...
#define NSTARS 10
void loopdemo2(void){ ...
» double mass[NSTARS];
» for ( int star=0;star<NSTARS; ++star) {
»printf("Please enter mass of star %d\n", star);
»scanf("%lg", &massstar);
}
// ... Do something interesting
NB: the actual memory address of each variable is
the address shown plus 4290062976 (0xFFB52A80).
Show Advanced options
.
Input was:
0.7 1.3 2.2 3.7 4.8 5.2 6.1 7.3 8.6 9.1
Show output
(Before looking at the output,
work out what you think it put should be and see if you are right.)
Output
Please enter mass of star 0
Please enter mass of star 1
Please enter mass of star 2
Please enter mass of star 3
Please enter mass of star 4
Please enter mass of star 5
Please enter mass of star 6
Please enter mass of star 7
Please enter mass of star 8
Please enter mass of star 9