Passing pointers between setup and loop
What you have to understand is the concept of scope.

Everything (well, almost everything) in C and C++ is enclosed in { and }. Those define a scope, and everything defined within that scope is available to any other scopes defined within that scope.

You can also assume that the whole sketch is surrounded by { and }. This scope is called the global scope.  Anything defined within it is available anywhere in your sketch.

So by defining the object in the global scope it is available everywhere:

# include "Leddisplay.h"

Leddisplay *pRightDigit;

void setup() {
    byte Digit[9] = { 22, 23 , 24 ,25, 26, 27, 28, 29, 2 };
    pRightDigit = new Leddisplay(Digit);
}

void loop() {
    pRightDigit-&gt;setDigit(5);
    pRightDigit-&gt;displayDigit();
}


However the use of new etc is discouraged in low-memory systems. Better is to statically define the object:

# include "Leddisplay.h"

const byte Digit[9] = { 22, 23 , 24 ,25, 26, 27, 28, 29, 2 };
Leddisplay pRightDigit(Digit);

void setup() {
}

void loop() {
    pRightDigit.setDigit(5);
    pRightDigit.displayDigit();
}


Note that, when statically defined like this, things in the constructor aren't guaranteed to be run at the right time. They should be moved into a .begin() function that you then call from setup():

# include "Leddisplay.h"

const byte Digit[9] = { 22, 23 , 24 ,25, 26, 27, 28, 29, 2 };
Leddisplay rightDigit(Digit);

void setup() {
    rightDigit.begin();
}

void loop() {
    rightDigit.setDigit(5);
    rightDigit.displayDigit();
}