Can you declare a pointer as extern in C ++?
I have the following bit of legacy C ++ code that won't compile:
#include <stdio.h>
#include <iostream>
extern ostream *debug;
GCC (g ++) complains: "expected initializer before" * token "
Looking around, it seems more common to declare them as external links, for example:
extern ostream& debug;
Why is the pointer invalid but the link is in this situation?
DECISION:
The real problem, as mentioned below, is the lack of the std :: namespace specifier. Apparently this was common in older C ++ code.
+1
source to share