The a.cpp file will not read from a.h, could someone please tell me why? I asked earlier but did not get much help due to bad posting. My apologies to all you who i have burdened with my rookieness(not a word). Hopefully i did it right this time.

// File a.h

#ifndef LINEAR
#define LINEAR

class linear
     {
     public:
             linear();
             linear(int);
               
               // SET MAX VALUE
             void setmv();
               
             // FUEL CONSUMPTION
             void fuelconsum();
             // void fuelconsum(int);
             
             // FUEL FLOW RATE
             void frate();
             // void frate(int);
             
             // LANDER MASS
             //void massl();
             void massl(int);
             
             // LANDER THRUST
             //void thrust();
             void thrust(int);
             
             // ADD FUEL, ALTITUDE
             //void increment(int);
             
             // REDUCE FUEL, ALTITUDE
             // void decrement(int);
             
             // ALTITUDE
             //void alt();
             void alt (int);
             
             // FUEL IN TANK
             void tankf();
             //void tankf(int);
             
             // VERTICAL SPEED
             void vspeed();
             //void vspeed(int);
             
             int getCount() const;
           
             int getMaxValue() const;
             
        private:
                     int count() const;
                     int mv() const;
             };

// File: a.cpp

#include "a.h"
#include <iostream>
#include <climits>
using namespace std;

linear::linear()
    {
                    count = 0;
                    mv = INT_MAX;
                    }
linear::linear(int mval)
    {
                    count = 0;
                    mv = mval;
                       }
    // ALTITUDE
void linear::alt()
    {
         Count = 1000;
         mv = INT_MAX;
         }
     // FUEL IN TANK
void linear::tankf()
    {
         Count = 1700;
         mv = INT_MAX;
         }
     // FUEL CONSUMPTION
void linear::fuelconsum()
    {
         Count = 10/secs;
         mv = INT_MAX;
         }
    // LANDER THRUST
void linear::thrust()
    {
         Count = 5000;
          mv = INT_MAX;
         }
    
    // VERTICAL SPEED
void linear::vspeed()
    {
         Count = 0/(vdistance/secs);
         mv = INT_MAX;
         }
    
     // FUEL FLOW RATE
void linear::frate()
    {
         if(frate > 0 && frate ==0)
         {
         Count =0;
         }
         else
         Count(int);
         mv = INT_MAX;
         }
   
    // LANDER MASS W/O FUEL
void linear::massl()
    {
         Count = 900;
         mv = 2600;
         }
  
         
int linear::getCount()
    {
         return count;
         }
int linear::getMaxValue()
    {
         return mv;
         }

If you are compiling a.cpp what makes you think a.h is not being included?

If you are compiling a.cpp what makes you think a.h is not being included?

Lets see whats makes me think that?

Ah this

3 C:\Documents and Settings\Compaq_Owner\Desktop\New Folder (5)\linear.cpp In file included from C:\Documents and Settings\Compaq_Owner\Desktop\New Folder (5)\linear.cpp

is what keeps getting displayed. Have you tried compling it. On a program.

Lets see whats makes me think that?

Ah this

3 C:\Documents and Settings\Compaq_Owner\Desktop\New Folder (5)\linear.cpp In file included from C:\Documents and Settings\Compaq_Owner\Desktop\New Folder (5)\linear.cpp

is what keeps getting displayed.

That doesn't tell us anything. There's errors displayed under that; these are simply describing the files that the errors occured.

OK, just because you asked, I've tried compiling it. There's quite number of small syntax errors, but nothing related to header files (just so you know, a.h never had a #endif statment at the end).

That doesn't tell us anything. There's errors displayed under that; these are simply describing the files that the errors occured.

OK, just because you asked, I've tried compiling it. There's quite number of small syntax errors, but nothing related to header files (just so you know, a.h never had a #endif statment at the end).

Thanks joe it works fine right now.

Thanks joe it works fine right now.

So I guess you have solved all the problems. Great! :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.