im using the dev c++ compiler. the same one as at my high school. its a pretty basic program, it just wants me to read in 10 random numbers and show the average of the ten numbers and then list any of those numbers that is above the average. (using vectors) it ran perfectly at school. now it wont. maybe im making a simple error? its saying "apvector.h;no such file or directory. but this is the code my teacher gave me and it ran before. help please!

#include<iostream.h>
#include<iomanip.h>
#include"apvector.h"


int main()
{
    int num;
    int sum;
    int avg;

    apvector<int>num(10);

    for(int x=0;x<=9;x++)
    {
                     cout<<"Please enter a real number and press <enter> to continue"<<endl;
                     cin>>num[x];
    }

    system("cls");
    sum=num[0]+num[1]+num[2]+num[3]+num[4]+num[5]+num[6]+num[7]+num[8]+num[9];
    avg=sum/10;

    cout<<"The average of the ten numbers is: "<<avg<<endl;
    for(int x=0;x<=9;x++)
    {
           apvector<int>num(10);
           {
                   cout<<num[x]<<endl;
           }
    }

    system("pause");
    return 0;
}

Edited 3 Years Ago by mike_2000_17: Fixed formatting

The #include directive will, depending on wether it uses "" or <>, look in different places of your system to find the required files to compile.

<> looks in your compiler's include directory. With Visual Studio this could be by default:
C:\Program Files\Microsoft Visual Studio 9.0\VC\include

"" first looks in your project folder and, if it doesn't find it ther, it will look in the compiler's include directory.

Note that you can set up more inclusion directories with your compiler.

So, make sure you have the apvector.h file in the proper place.

This article has been dead for over six months. Start a new discussion instead.