Problem to make a library

Hello everyone,

I like to port my code to a libary. So i started simple, but even that gave me trouble
In the constructor i have some bytes that i want to asign,
but when a read them back the are still 0x00 ?
Can someone put me on the right track here ?
Here is mine Soladin.h

  Soladin.h  - Library for comunicating to a Soladin 600.

#ifndef Soladin_h
#define Soladin_h

#include "WProgram.h"

class Soladin
    Soladin();       // constructer     
    char Readbyte() ;  // test call 
    int ReTrn(char *txbuf) ;
    void Concat(char des[2], char cmd[2], char *OutBuf) ;
    void SndBuf(int size, char *OutBuf);
    char SourceAdr[2] ;
    char DestAdr[2] ;
    char Probe[2]  ;

And Soladin.cpp

#include "WProgram.h"
#include "Soladin.h"

Soladin::Soladin() {
    char SourceAdr[] = { 0x00, 0x00 };
    char DestAdr[] = { 0x11, 0x00};
    char Probe[] = { 0xC1, 0x00} ;

char Soladin::Readbyte(){

and the pde

#include <Soladin.h>

Soladin sol; // Soladin object

void setup()

void loop() {
  char a = sol.Readbyte();
    char SourceAdr[2] ;
    char DestAdr[2] ;
    char Probe[2]  ;

These are class fields.

    char SourceAdr[] = { 0x00, 0x00 };
    char DestAdr[] = { 0x11, 0x00};
    char Probe[] = { 0xC1, 0x00} ;

These are local variables with the same name. Why?

Good question, Maby you can explain me a bit about these decelartions ? so i choose the one i need. Thanks teding.

The class members are available to all functions in the class. However, they can not be initialized when they are declared.

So, it looks like you are defining new arrays in the constructor, hoping that, somehow, they will replace/initialize/whatever the class members. They will not. They will, however, go out of scope as soon as the constructor ends, leaving the class members uninitialized.

You need to initialize the class members correctly, not create new arrays, in the constructor.

SourceAdr[0] = 0;
SourceAdr[1] = 0;
DestAdr[0] = 0x11;
DestAdr[1] = 0;
Probe[0] = 0xC1;
Probe[1] = 0;