bashill.zhu@gmail.com
9/28/2008 11:07:00 PM
On 9?28?, ??11?54?, Obnoxious User <O...@127.0.0.1> wrote:
> On Sun, 28 Sep 2008 07:17:04 -0700, bashill....@gmail.com wrote:
> > Administrator@HILL /d/Users/Administrator/Desktop/tcplex/ch8/ex3_test $
> > cat lexer.h
> > namespace Lexer
> > {
> > char get_char();
> > void foo();
> > }
> > $ cat lexer.cpp
> > #include "lexer.h"
> > #include <iostream>
> > namespace Lexer
> > {
> > extern std::istream* input;
> > int g_i;
> > }
> > char Lexer::get_char()
> > {
> > char ch;
> > g_i = 100;
> > input->get(ch);
> > return ch;
> > }
>
> > void Lexer::foo()
> > {
> > g_i = 200;
> > char c;
> > input->get(c);
> > return;
> > }
> > $ cat main.cpp
> > #include "lexer.h"
> > #include <iostream>
> > using namespace std;
>
> namespace Lexer {
>
> > istream* input;
> }
>
> --
> OU
> Remember 18th of June 2008, Democracy died that afternoon.http://frapedia..se/wiki/Information_in_English- ??????? -
>
> - ??????? -
I got the point.
When do this i should initialize the input pointer oursize the module
to let it points to a object .
Thanks in advance.