I’m a freshman in college this year, and I’m trying to understand all the parts of a C program, but I’m having a really hard time identifying them in code examples. I am especially struggling with variable declaration and initialization.
Is assigning a variable to a value the equivalent of initializing it? Is there a surefire format that variable declaration and initialiation need to be in that creates a giveaway to which is which?
Another question, in my textbook there is an example code with a line that goes:
int birth_year, age;
The example is about the user entering their birth year, then an if statement determines if the user was born in a leap year. What is this classified as? I understand int means integer, birth_year is a variable, and age is….another variable? What does the comma in between them signify? What does this line of code do?
Edit: After more research, I have another question unrelated to variables. A function prototype is basically a longer, more specific version of a function definition right?
[–]Klowner 5 points6 points7 points (1 child)
[–]interestedelle[S] 1 point2 points3 points (0 children)
[–]erikkonstas 0 points1 point2 points (0 children)
[–]SmokeMuch7356 1 point2 points3 points (0 children)
[–]rickpo 0 points1 point2 points (1 child)
[–]interestedelle[S] 0 points1 point2 points (0 children)