It seems to be very simple, but I can't figure it out. Here is question: I have a simple function that returns a string:
const wchar_t* getCompanyName() { return L"Test Company";};
I want to define a macro like the following:
#define COMPANY getCompanyName();
#define PRODUCT COMPANY L" in Canada"
const wchar_t * company = COMPANY;
const wchar_t * product = PRODUCT;
I would expect to see the "product" value is "Test Company in Canada", but it only shows "Test Company" and string "in Canada" never concat to the product string
Thank you so much for your time, here is the full code:
#include <stdio.h>
#include <tchar.h>
const wchar_t* getCompanyName() { return L"Test Company";};
#define COMPANY getCompanyName();
#define PRODUCT COMPANY L" in Canada"
int _tmain(int argc, _TCHAR* argv[]) {
const wchar_t * company = COMPANY; // get Test Company
const wchar_t * place = PRODUCT; // get Test Company in Canada
wprintf(company);
wprintf(place);
return 0;
}