DIGIT-ARC read-only archive · snapshot: July 23, 2026

compiler not working properly

5 posts · originally from https://geek.digit.in/community/threads/compiler-not-working-properly.168099/

Ashokkumar01cbe
Ashokkumar01cbe Original post #1
Dec 27, 2012 at 4:44 PM
Hi,
first my system specs is windows 7 ultimate 64 bit. i5 processor,4 GB RAM,I am using codeblocks software for the compilation of my c programs. yesterday i do a little program in c++ .i gave the header file <iostream.h>
it shows up that there is no such file in the directory.please help me to solve the issues.............:confused:
krishnandu.sarkar
Dec 27, 2012 at 7:12 PM
Well, which compiler you are using?

And BTW iostream.h is obsolate instead use "#include<iostream>"

Then at next line use "using namespace std;"
krishnandu.sarkar
Dec 27, 2012 at 10:47 PM
Nice..!!

#include<iostream.h> is obsolate. Instead try what I suggested.
Vyom
Vyom #5
Dec 27, 2012 at 11:09 PM
A sample program which compiles on GCC compiler in code::blocks. Should give you a head start:

PHP:
#include<iostream>

using namespace std;

class item
{
    private:
        int item_code;
        float price;

    public:
        void initialize(int c, int p)
        {
            item_code = c;
            price = p;
        }

        void input()
        {
            cout<<"\nEnter item code : ";
            cin>>item_code;
            cout<<"\nEnter item price : ";
            cin>>price;
        }

        void display()
        {
            cout<<"\n"<<item_code<<"\t"<<price;
        }
};

int main()
{
    item item[5];

    for(int i=0; i<5; i++)
    {
        cout<<"\n\nEnter details of Item # "<<i+1;
        item[i].input();
    }

    cout<<"\nItem\tPrice";
    for(int i=0; i<5; i++)
    {
        item[i].display();
    }

    return 0;
}