Tell me how to work with such a three point in brackets. I need a function that summarizes an indefinite number of integers. You can use an example or a link to a normal resource.
---- UPDATED AFTER 2 COMMENTS --------
#include <iostream> using namespace std; void f(int a, ...){ int * p = &a; while (*p){ cout << *p << endl; p++; } } int main(){ f(1, 3, 56, 4); return 0; } ---------------conclusion---------------------------------- ---
1 3 56 4 22997204 30403626 2147303424 -858993460 -858993460 1245112 4305311 1 3430632 3421160 -1011716776 22997204 30403626 2147303424 -1302397296 I do not understand where the garbage is taken from?