Fatal error: iostream: No such file or directory in compiling C program using GCC
Neither <iostream> nor <iostream.h> are standard C header files. Your code is meant to be C++, where <iostream> is a valid header. Use a C++ compiler such as clang++ or g++ (and a .cpp file extension) for C++ code. Alternatively, this program uses mostly constructs that are available in C anyway. It’s easy enough to convert the entire program to compile using a C compiler. Simply remove #include … Read more