Problem:
I am a new student of c++ programming. I am taking an online-based course to learn it. I’ve written a pretty simple program that adds two numbers through a function. I am attaching my code snippet below, please have a look:
int promptNumber()
{
int n;
std::cout << "Number: ";
std::cin >> n;
return n;
}
void saveAnswer(int x)
{
std::cout << "Answer: ";
std::cout << n;
}
This is my io.cpp file. I’ve added both
#include <iostream>
#include "add.h"
header files starting on my main.cpp file but I can’t run the program. I keep getting an error: cout is not a member of std
Could any of you please shed some light on this?