M
marbac
Hi,
i was just testing a class within main and was wondering why this works :
#include <iostream>
class testclass {
public:
testclass (int _test) : test(_test){};
private:
int test;
};
int main () {
testclass (8);
std::cout<<"Seems to work?"<<std::endl;
return 0;
}
My Question: What does "testclass (8);" do? (works without compilation
error with g++ (gcc) (3.3.3), stdout:"Seems to work?" ).
regards marbac
i was just testing a class within main and was wondering why this works :
#include <iostream>
class testclass {
public:
testclass (int _test) : test(_test){};
private:
int test;
};
int main () {
testclass (8);
std::cout<<"Seems to work?"<<std::endl;
return 0;
}
My Question: What does "testclass (8);" do? (works without compilation
error with g++ (gcc) (3.3.3), stdout:"Seems to work?" ).
regards marbac