Use other class methods in my class

Hi.

I need to resolve my problem!

untitled.ino [code

include "my_library.h"

my_library test(5, 5, 5);

void setup() { } void loop() { } [/code]

my_library.cpp

#include "my_library.h"

my_library::my_library(byte one, byte two, byte three) {
    LCD_library test(one, two, three);
}

void my_library::print {
    test.display();
}

I need to use other class methods in my class with constructor, but I don't know how should I do it.

Thanks for help!

Post you full code in Code Tags -- .ino file, .h file, .cpp file. Preferably something that actually compiles. Failing that what you post should at least show the same compiler errors as you're seeing.

my_library.cpp

#include "my_library.h"

#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_PCD8544.h>

my_library::my_library(uint8_t sclk, uint8_t din, uint8_t dc, uint8_t cs, uint8_t rst) {
    Adafruit_PCD8544 display(sclk, din, dc, cs, rst);
}

void my_library::draw_text() {
    display.clearDisplay();
}

my_library.h

#ifndef my_library_h
#define my_library_h

class my_library {
    public:
        my_library(uint8_t sclk, uint8_t din, uint8_t dc, uint8_t cs, uint8_t rst);
    private:
        void draw_text();
};

#endif

The problem is, I am creating display in constructor of my library so it is not global. But how can I turn adafruit display class to global?

More like this:

.h file:

#ifndef my_library_h
#define my_library_h

#include <Adafruit_GFX.h>
#include <Adafruit_PCD8544.h>
#include <SPI.h>

class my_library {
  public:
    my_library(uint8_t sclk, uint8_t din, uint8_t dc, uint8_t cs, uint8_t rst);
    void draw_text();

  private:
    Adafruit_PCD8544 display;
};

#endif

.cpp file:

#include "my_library.h"
my_library::my_library(uint8_t sclk, uint8_t din, uint8_t dc, uint8_t cs, uint8_t rst)
  : display(sclk, din, dc, cs, rst) {
}

void my_library::draw_text() {
  display.clearDisplay();
}

IT WORKS, THANKS A LOT!

Can you please explain or can you give me the link to explaination on this part:

my_library::my_library(uint8_t sclk, uint8_t din, uint8_t dc, uint8_t cs, uint8_t rst) : display(sclk, din, dc, cs, rst) { }

Google "c++ initializer list"