every thing works perfectly up until I use inherentence, the "temp.txt" is empty and i think thats my problem , i may be calling the class wrong ( in bold above) any help would be greatful. heres my errors when ran:

/usr/file.h: In member function âfloat* NUM_STUD ::ADD_STUD()â:
/usr/file.h:line#: warning: address of local variable X returned

out put in "final_file.text" is
The final grade for students are
USING INHERITANCE:

Data from final "temp.txt' is not there. any help with this, don't worry about the inhereted class "ADD_STUD()" it works , but the temp.txt file genreating.

it generates a empty "temp.txt" file that I'm looking for, I don't if the code above is the proper way to inherit the "NUM_STUD" class. The file.h file can't be changed and is an example of how my real project on matrixes look like. I just want to use inherentence to call a base class function to generate a file so that I can use that file in my new function to output into a new file. Does that make more sense.

At least one note, somewhere along the code you have: output_file<<"Answer:" << endl; and later on you are attempting to read in values from the very same file in_stud>>m[i]; That just silently fails because of the string you have written there (I'm assuming here that m[] holds floats <-> I did not find declaration of 'm' anywhere in the code you've posted).

I found out what my problem was, I posted this sample code to show you my overall srucure not for it to be evaluated. The problem was that the file.h was suppose to generate a temp file I was wrong. I was suppose to use inheretence to populate the members in the file that.h file so that I can use a pointer to get the values that was being return by the float interger X. thanks for your help though.