10
I want to write a simple C++ code in visual studio 2012 but always getting a error C1004 in the header file. Could anyone please help me?
My code is given below. I am new in visual studio C++, so this may be very silly error.
add.cpp
#include <iostream>
int add(int a, int b)
{
return a+b;
}
add.h
#ifndef ADD_H
#define ADD_H
int add(int a, int b);
#endif
source.cpp
#include "add.h"
#include <iostream>
int main()
{
std::cout << add(3, 4);
return 0;
}