Change initialization to:
record list[] = { {1, "one"}, {2, "two"}, {3, "three"} };
Your initialization with (...)leaves an effect similar to {"one", "two", "three"}, and creates an array of structures with elements{ {(int)"one", "two"}, {(int)"three", (char *)0} }
the comma operator in C evaluates expressions from left to right and discards all but the last. That's why 1, 2and 3discarded.
source
share