Declaring variables

Hey guys im facing a problem in declaring variables. i have a few classes like the one below...

#ifndef _FINANCE_H
#define    _FINANCE_H

#include <string>
#include <iostream>
#include <fstream>
#include <stdlib.h>

using namespace std ;


class  readStraitsTimesIndex
{
    public:
         void StraitsTimesIndex(fstream&) ;
    private:
};

class readDow
{
    public:
        void Dow(fstream&) ;
    private:
 };

[/CODE]
what i am trying to do is to use a value which is being the output of one of the class class and to be displayed into the other class. I tried using an object member like the one below ,

class  readStraitsTimesIndex
{
    public:
         void StraitsTimesIndex(fstream&) ;
String value ;
    private:

};

[/CODE]

and then assigned a value to it, but it will only work within the class. how do i go about saving a certain variable and using it in all the classes

What do you mean by 'using it in all the classes'? Anywhere you have a readStraitsTimesIndex object you have access to its 'value' member. You must be creating the object sometime for that code to get called at all, right?

What i meant is, for example... i run a class and it gives me an output of "abc". i would then want to use this output to be displayed in a seperate class. What i tried was...

class  readStraitsTimesIndex
{
    public:
         void StraitsTimesIndex(fstream&) ;
String value ;
    private:
};

i put the output of "abc" into value. and then in the cpp of the other class, i tried to read it out. but all it gave me was a blank. I do not think i can make it public as i have to use the value given to me by the running of the 1st class

Objects don't work that way. They don't transfer between themselves magically, you have to give them some way to do so. There's a lot of ways.

class MyClass
{
public:
        MyClass() { value=4; }

        getValue() { return(value); }

        int value;
};

class OtherClass
{
public:
        void use_result_obj(const MyClass &my)
        {
                cout << "value=" << my.value << "\n";
        }

        void use_result_int(int value)
        {
                cout << "value=" << value << "\n";
        }
};

int main(void)
{
        MyClass a;
        OtherClass b;

        // generate result in a.value
        a.some_function();

        // one way to transfer
        b.use_result_obj(a);
        // another way
        b.use_result_int(a.value);
        // yet another way
        b.use_result_int(a.getValue());
        return(0);
}

You might want to review some basic C++.