cplusplus:pointers_4_slides
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
cplusplus:pointers_4_slides [2021/10/24 02:59] – [Example] mithat | cplusplus:pointers_4_slides [2021/10/24 03:02] (current) – [Pointers 4 slides] mithat | ||
---|---|---|---|
Line 7: | Line 7: | ||
Gaddis, Tony. " | Gaddis, Tony. " | ||
Mithat Konar\\ | Mithat Konar\\ | ||
- | March 31, 2019 | + | October 23, 2021 |
===== Dynamic memory allocation ===== | ===== Dynamic memory allocation ===== | ||
Line 241: | Line 241: | ||
int main() | int main() | ||
{ | { | ||
- | double *sales = nullptr, // To dynamically allocate an array | + | double *sales = nullptr, |
- | total = 0.0, // Accumulator | + | total = 0.0, // Accumulator |
- | average; // To hold average sales | + | average; |
- | int numDays, // To hold the number of days of sales | + | int numDays, |
- | count; // Counter variable | + | count; |
// Get the number of days of sales. | // Get the number of days of sales. | ||
Line 298: | Line 298: | ||
* '' | * '' | ||
* Part of C and so are available in C++ as well. | * Part of C and so are available in C++ as well. | ||
- | * More cumbersome than '' | + | * More cumbersome than '' |
===== Returning Pointers from Functions ===== | ===== Returning Pointers from Functions ===== |
cplusplus/pointers_4_slides.1635044362.txt.gz · Last modified: 2021/10/24 02:59 by mithat