c - How do you store an array into a variable? -
if have array of 4 values, how store values 1 variable?
char d[4]; int allvalues; d[0] = 1; d[1] = 2; d[2] = 3; d[3] = 4;
i want allvalues = 1234. if add piece of code, output comes out different.
allvalues = d; printf("%d", allvalues);
thank you!
allvalues = d[3] + 10 * ( d[2] + 10 * ( d[1] + 10 * d[0]));
Comments
Post a Comment