All pastes #87953 Raw Edit

Untitled

public text v1 · immutable
·published 2006-07-14 10:09 UTC
rendered paste body
#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)