Programming: Declaring Multiple Variable with the Same Type on a Single Line
Share
If multiple variables need to be declared and they are of the same type and they need to be initialized with the same value, this can be done in a single line using commas.
Usage: type variable1, variable2 = value; Example: int variable1, variable2 = 0;