First of all, i have a Resources.h file, which has the following statement:

#include <iostream>
#include <string>

#define string Greeting "Hi"

So i also have Prompt.cpp;

#include <iostream>
#include <string>
#include "Resources.h"

int main()
cout << Greeting << endl;

But, i have a problem: It won't recognize Greeting...

How do i "make" him to recognize Greeting which i have defined..?

Recommended Answers

All 3 Replies

why not just #deifne Greeting "HI"


Missing ; before <<

You need to either Prepend std:: to your cout std::cout or add a using namespace std; before your main function (and typically after your includes)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.