#include "stdafx.h"
using namespace System;
class Calculater; // how to tell the compiler that the class is down there?
int main(array<System::String ^> ^args)
{
::Calculater *calculater = new Calculater();
return 0;
}
class Calculater
{
public:
Calculater()
{
}
~Calculater()
{
}
};
Im declaring the class after main, how do i tell the compiler were my class is? i tried
class Calculater; before main but its not working.
You can't do it how you've written it. The compiler has to be able to see the definition of the class before it can use it. You need to put your class before your main
function, or preferably in a separate header file which you include.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With