I have a Test class like following
#include "Test.h"
#include <iostream>
void Test::Display()
{
std::cout << "Hello"<<std::endl;
}
I don't understand how can I call a function in Test class without creating an object of Test class
void TTest(Test* ptrTest);
int main()
{
//Test* t = nullptr;// = new Test();
TTest(NULL);
while (true) { }
std::cout << "Hello World!\n";
}
void TTest(Test* ptrTest)
{
if (ptrTest == NULL)
{
std::cout << "Obj is Null" << endl;
}
ptrTest->Display();
}
Output is: Obj is Null Hello
Help me in understanding this code, please.