I am completely new to using
C++ the issue i'm having is with the
Codeblocks IDE.
I made a simple calculator and it worked completely fine before but since I have re-opened it there seems to be an error..
#include <iostream>
using namespace std;
int main()
{
int a;
int b;
int sum;
cout << "How old are you? \n";
cin >> a;
cout << "Add X amount of years \n";
cin >> b;
sum = a + b;
cout << "You will be " << sum;
return 0;
}
The issue is with
#include <iostream>
The log is saying "
fatal error: iostream: no such file or directory "
Does anyone have any idea why this might be happening?
Update-
I've found out now that I need to change the file to a .cpp ( to compile it as a C++ ) rather than a .c ( to compile as a C ) is there anyway that I can set Codeblocks to automatically make it a .cpp file? or will it forever make me rename the file, close it, and re-open it to fix this issue?