shibaking
shibaking

Reputation: 71

Beginner at programming. C++ colon on line 9 included in this example code from textbook. I understand up to line 8 but what does the colon do?

Colon on line 9 is throwing me off. I'm not sure what its purpose is.

    #include <iostream>
    using namespace std;

    const int TOTALYEARS = 100;

    int main()
    {
        int ageFrequency[TOTALYEARS]; // reserves memory for 100 ints
        :
        return 0;
    }

Upvotes: 0

Views: 92

Answers (2)

shibaking
shibaking

Reputation: 71

Not sure if this was insinuating cheating or copying from review notes. The example was, in fact, from the guided reading that is assigned before the knowledge is applied to various exercises that follow.

lab reading

Upvotes: 0

DanyAlejandro
DanyAlejandro

Reputation: 1468

Just checked the "texbook" contents (which are some review notes actually). That's not a colon, that's the academic way of saying "other miscellaneous non-important code goes here". Something like:

int ageFrequency[TOTALYEARS]; // reserves memory for 100 ints
.
.
.
return 0;

Here's a screenshot for confirmation:

enter image description here

You're expected to ignore those symbols.

Upvotes: 1

Related Questions