CS1302: 2026-01-27
ONE-DIMENSIONAL ARRAYS
Usual Preparation
- Open Qunicy (with code if you have some)
- Open rustpad.io/#CS1302
- And I'll attempt to get the Google Meet started before you call me!
Introduction to One-Dimensional Arrays: <../CPP-Projects/Standalone/array-demo.cpp>array-demo.cpp
-
Additional notes at Geeks for Geeks
- How to declare an array
- This kind of array must have a fixed size.
- The indicies always go from [0] to [n-1], where n is the array's size.
- How to write a function with an array parameter
-
Normally, when a function is called, each argument to a function is copied in to the corresponding parameter. This is called pass-by-value.
Any changes that the function makes to a pass-by-value parameter does not directly affect the corresponding argument.
-
But array parameters are different. When the function is called, no copy is made of the array argument. Instead, the function's array parameter just
uses the array argument directly. This is called pass-by-reference. And any change that the function makes to an element in the array parameter
will actually change the element in the corresponding array argument.
- const array parameters
Possible Projects for the Next Week or So:
- Continue to work on the orbit project
- Newtonian starship: uses colors, more animation, discrete Newtonian physics
- Newtonian particles: more animation, arrays, discrete Newtonian physics. mouse input
- Lunar lander: uses colors, a bmp background, discrete Newtonian physics, keyboard and mouse input
- The Mandelbrot fractal: uses RGB colors, arrays, zooming and shifting in Cartesian coordinates, keyboard and mouse input
- Music visualizer: uses a sound playing library, arrays, open-ended music visualizers, and perhaps Fourier transformations for a more advanced verseion.
Introduction to Indexing in the ITTDB:
- Choosing your librarian names, login names, and passwords
- El Anacronópete by Enrique Gaspar (1887)
- Its ITTDB page
- Its development page
- Its editing page (still under development)
- The ITTDB Tags (needs a lot of work!)
-
Choose something to index from
this list of stories discussed in Worlds Enough and Time by Gary Westfahl;
or from
this other list of stories discussed in Time Machines by Paul Nahin.
NOTE: Before choosing a story, click on the More Details list and ensure that it doesn't yet have a Librarian listed at the bottom. (It should have
me listed as the Curator. When you've selected a story, let me know and I'll help you find it in an online library. Also send me your individual
choice of your librarian name, login name, and password for the ITTDB.
- If you'd like, watch with your family: Somewhere in Time by Richard Matheson, directed by Jeannot Szwarc (available on Amazon Prime Video with ads).