help using INT

I'm pretty new to arduino and i got a 8-segment display

I was wondering, is this possible
Because I get an error
or is this just a fault in the code?
please help me.

// put your setup code here, to run once:
int D1[2]{3,6};
int D2[5]{4,5,2,6,7};
int D3[5]{4,5,2,8,7};
int D4[4]{3,5,2,8};
int D5[5]{4,3,2,8,7};
int D6[6]{4,3,2,6,8,7};
int D7[3]{4,5,8};
int D8[7]{4,3,5,2,6,8,7};
int D9[6]{4,3,5,2,8,7};
int D0[6]{4,3,5,6,8,7};
pinMode(D1,OUTPUT);
digitalWrite(D1,HIGH);
}

;}

Nomisvdp:
Because I get an error

Please post the error message.

I think your array definitions are all wrong.
Try this

 int D1[2] = {3,6};

This is nonsense in this context

 pinMode(D1,OUTPUT);

The first argument for pinMode() must be the name of an I/O pin. You can't give it an array.

Perhaps you meant to write

 pinMode(D1[0], OUTPUT);

which, with this example would be the equivalent of

pinMode(3, OUTPUT);

...R

  // put your setup code here, to run once:
  int D1[][2]{3,6};
  int D2[][5]{4,5,2,6,7};
  int D3[][5]{4,5,2,8,7};
eyc
etc

Do you really want to declare these arrays in setup() thus limiting their scope to that function ?

Thanks a lot!!!
And no, but i was still looking if it'd worked

so, now i made it something like this, is this right?

void setup() {
// put your setup code here, to run once:
float i = 0;
int D1[2]{3,6};
int D2[5]{4,5,2,6,7};
int D3[5]{4,5,2,8,7};
int D4[4]{3,5,2,8};
int D5[5]{4,3,2,8,7};
int D6[6]{4,3,2,6,8,7};
int D7[3]{4,5,8};
int D8[7]{4,3,5,2,6,8,7};
int D9[6]{4,3,5,2,8,7};
int D0[6]{4,3,5,6,8,7};
for(int i=0;i>=2;i++){
pinMode(D1*, OUTPUT);*
_ digitalWrite(D1*,HIGH);}_
_
}_
void loop() {
_
// put your main code here, to run repeatedly:*_

;}

is this right?

No. In fact, what did you change ?

;}

no, heck no, frog no; heck frogging no. just: no

oops, wrong code copied :confused:

this is the right one
void setup() {
// put your setup code here, to run once:
float i = 0;

void setup() {
  // put your setup code here, to run once:
  float i = 0;
  int D1[][2]{3,6};
  int D2[][5]{4,5,2,6,7};
  int D3[][5]{4,5,2,8,7};
  int D4[][4]{3,5,2,8};
  int D5[][5]{4,3,2,8,7};
  int D6[][6]{4,3,2,6,8,7};
  int D7[][3]{4,5,8};
  int D8[][7]{4,3,5,2,6,8,7};
  int D9[][6]{4,3,5,2,8,7};
  int D0[][6]{4,3,5,6,8,7};
  for(int i=0;i>=2;i++){
  pinMode(D1[i], OUTPUT);
  digitalWrite(D1[i],HIGH);}
}

void loop() {
  // put your main code here, to run repeatedly:
  


;}

Nomisvdp:
I was wondering, is this possible

Is what possible? What do you want the code to do?

  int D1[][2]{3,6};
  int D2[][5]{4,5,2,6,7};

Again, no
Again, what did you change ?

You seem to know how to declare a variable

  float i = 0;

It has a data type, a name and you set it equal to a value

Stop guessing how to declare an array and read up on it in any C tutorial

I'm pretty new to arduino and i got a 8-segment display

What type display did you get, and how are you connecting it to the arduino?

If your code is an attempt to light up specific segments of an LED display, then you are doing it completely wrong, but without more details noone can give you much help.