¥log.h
#pragma once
void Log(const char* message);
log.cpp
#include <iostream>
void Log(const char* message)
{
std::cout << message << std::endl;
}
Main.cpp
#include <iostream>
#include "log.h"
int main()
{
//const char* ptr = "hello";
const char* ptr = NULL;
if (ptr)
Log(ptr);
else
Log("Ptr is null!");
int x = 6;
if (x == 5)
Log("HelloWorld");
std::cin.get();
}