quickly (re)set an array

  int testar[4]={1,2,4,8};

  ...

  testar={0,0,0,0};

Is there a way to do something like this? Or is there a way to quickly reset an array of ints? Or even better fill it with values, or do I need to put it in a for next loop or something?

This question must have been asked a thousand times before but I couldn't find an answer in the forum.

Use memset.

int testar[4] = {1, 2, 4, 8};

void setup() {
  Serial.begin(9600);

  int i;

  Serial.println("Testar ");
  for (i = 0; i < 4; i++) Serial.println(testar[i]);

  memset(testar, 0, sizeof(testar));

  Serial.println("Testar ");
  for (i = 0; i < 4; i++) Serial.println(testar[i]);


}

void loop() {}

Serial monitor:

Testar 
1
2
4
8
Testar 
0
0
0
0

interesting, thanks for the reply. Did not think of memset.

Does memset only write bytes or can I write ints as well with memset in Arduino?

It only writes bytes. Use:

memset(testar, 0, sizeof(testar)*sizeof(int));

You can use a for loop to set an array of any type to any value. It can even be done with no body for the for loop, if you are even a little bit clever.