Full Version : Multi-dimensional array
avr >>C PROGRAMMING (AVR) >>Multi-dimensional array


alex_knox@danfoss.com- 09-04-2007
Hi

I am using AVR Studio, Version 4.13.
When I try to implement a 2 dimensional array of int values e.g.

int TestArray[2][2] = {1,2,
3,4};
I get the warnings:
"Missing braces around initialiser"
and
"Near initialisation for 'TestArray[0]'"

If I remove the values and leave an empty array, the warnings disappear
Is this a bug with AVR sTudio

Silka- 09-05-2007
Hi,

If you want to use a multidimensionnal array you have to write :

int TestArray[2][2] = {{1,2},{3,4}};

Forumer™ is Voted #1 Free Forum Hosting provider
Build your own community today with the largest message board hosting company.