what different that's code >.<

hi im jonny.

i want ask something about this code. what the point different

1 . #define A {31, 36, 68, 36, 31} 

========================

  1. int A[5] = {31, 36, 68, 36, 31}

i have variable array 2D.

int frase[1][1] = {A} // if im using this for point number 1 this work. but if im using point number 2 can't work.

and how simple implementing for 2 point above.

For me it's not clear.

All #define are simply a replacement text made by pre-compiler.

So with point 1 the declaration is:

int frase[1][1] = {  {31, 36, 68, 36, 31} }

point 2 it's not the same. You have 2 array/variables and second point the first (I think in wrong way).
I think not compile and also point 1 it's strange.

As nid69ita points out your syntax is broken.

However, I think the answer to your question is that initializations need to be constants known at compile time.

Since the #define in point 1 is just textual substitution it will work.

The other in point 2 is a standard variable. (You haven't provided enough context to tell if it is static or automatic.) The initialization happens at run time, so the variable is considered empty at compile time, so you can't use it to initialize another variable.

nid69ita:
For me it's not clear.

All #define are simply a replacement text made by pre-compiler.

So with point 1 the declaration is:

int frase[1][1] = {  {31, 36, 68, 36, 31} }

point 2 it's not the same. You have 2 array/variables and second point the first (I think in wrong way).
I think not compile and also point 1 it's strange.

hahaha thank you're advice.. little by little im understand when we use define and not. define is value constant. right ?

#define is a simple text replacement macro that can be used for a number of purposes, including code generation:

#define EVER (;;)
..
..
..
for EVER
{
  // an infinite loop.
}

On the Arduino, min and max are implemented as macros - beware of side-effects.

jonnygreenwood:
...define is value constant. right ?

Yes and Not !!! As written by AWOL is ONLY a replacement. Precompiler write for you many times the "constant" word everywhere it found the word.

Usually you can see sketch with this code for declaration of number of a pin:

#define PINLED 13
...
void setup()
{  pinMode(PINLED, OUTPUT);

Better is using a const declaration without #define

const byte PINLED=13;
...
void setup()
{  pinMode(PINLED, OUTPUT);

Really the compiler is intelligent and not create a variable const but do a substitution like #define (tested in another thread in italian with other programmers and seeing the assembly code generated using #define vs. const)
Now you declare a const as byte. So you define for the constant also the type. Not possible for @define

Some command/function are not a really function but a macro, a #define with parameters.
For example min() function it's a macro (see on Arduino.h) that use the inline if => (test) ? true : false

#define min(a,b) ((a)<(b)?(a):(b))