Untitled
public text v1 · immutable#include <stdio.h>
int main(void)
{
int a[5] = {5, 4, 3, 2, 1}; // Works!
int b[5];
b = {5, 4, 3, 2, 1}; // Not working :(
}
How do you fill a pre-declared array variable with constants? Assume you want to do
this:
int a[5];
if (expr)
a = {5, 4, 3, 2, 1};
else
a = {1, 2, 3, 4, 5};
(obviously not working)