hey guys,
i wrote this code and i have an error that i really couldnt understand i think it is in line 16 in bin.cpp
here is the code :
this is the header var.h
1>c:\users\admin\documents\visual studio 2008\projects\lab 9\lab 9\bin.cpp(6) : error C2084: function 'void binaryOperations::printSeparator(std::ostream &)' already has a body
1> c:\users\admin\documents\visual studio 2008\projects\lab 9\lab 9\bin.h(10) : see previous definition of 'printSeparator'
You are trying to implement printSeparator() in two locations, in the class definition and out side the class definition. You can only implement the same function once.
i removed it and it worked thank you all :) but one question, i did the exact same thing in var.h and var.cpp. i gave the function two bodies. can you tell me what is the difference between both cases? thanks again guys :D
I don't see anywhere in the variable class where you supplied two bodies.
Also just a nit, but you should be consistent about your brace placement. Sometimes you place it on the same line as the statement other times you place it on it's own line, be consistent.
Also you shouldn't be using semicolons after the closing brace of your functions, their unnecessary and some compilers will generate errors if they are present.