Notice: Undefined offset: 1886682 in /var/www/html/qa-external/qa-external-users.php on line 744
#include<iostream.h> this header file is not sported to a c++ programing - OnlineGDB Q&A
Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

#include<iostream.h> this header file is not sported to a c++ programing

+3 votes
asked Sep 9, 2022 by Bhumin Kathiriya (150 points)

1 Answer

+1 vote
answered Sep 10, 2022 by Peter Minarik (101,360 points)

The file's name is not iostream.h but just iostream.

So the include looks like this correctly:

#include <iostream>
commented Sep 11, 2022 by Bhumin Kathiriya (150 points)
I TYPE ONLY IOSTREAM BUT DIDNT WORK SOME ERRER ARE THERE
commented Sep 11, 2022 by Bhumin Kathiriya (150 points)
PLZ SOLUCTION THIS HEADER FILE INPUT C++ ONE PROGRAM NOT A RUN
commented Sep 11, 2022 by Peter Minarik (101,360 points)
You must be doing something wrong.

Can you save your project (4th button to the right of RUN) and share a link so we can see what's going on?
commented Sep 11, 2022 by (10,560 points)
Do you have c++ compiler installed ??
commented Sep 16, 2022 by Bhumin Kathiriya (150 points)
https://onlinegdb.com/heLbPOlV1

plz seen that this program not run to a c++ on gdb and i request to soluction is very soon.
commented Sep 17, 2022 by Peter Minarik (101,360 points)
First of all, you're trying to run it as a Turbo C++ project. Why not use the standard C++ instead? (C++ or C++20)

There are many problems with your code (after setting the target to be C++20):

1. conio.h is an MS-DOS library, not available on Linux (including OnlineGDB).
2. Extra closing brace at the end of the file.
3. You need to remove the conio.h related functions (clrscr and getch). They are there just for "formatting", no real functionality.
4. count is unknown as the fully qualified name is std::cout, so the compiler wouldn't find it. So either fully qualify the name or tell the compiler to try to append the namespace std in front of functions (using namespace std;)

Your code as modified below would run fine:

#include <iostream>

using namespace std;

class abc
{
    protected:
    void func()
    {
        cout<<"protected...";
    }
};

class xyz : protected abc
{
    public:
    void show()
    {
        func();
    }
};

int main()
{
    xyz obj;
    obj.show();
}
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and receive answers from other members of the community.
...