www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/05/15:02:45

From: Jason Nye <jnye AT nbnet DOT nb DOT ca>
Newsgroups: comp.os.msdos.djgpp
Subject: C++ scope resolution operator...
Date: Sun, 05 Oct 1997 14:42:22 -0300
Organization: NBTel Internet
Lines: 31
Message-ID: <3437D17E.A9F1CCAE@nbnet.nb.ca>
NNTP-Posting-Host: mctnts05c46.nbnet.nb.ca
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I wrote a test app to test djgpp's implementation of the C++ scope
resolution operator (::).  Apparently, there is no implementation, e.g.:

#include <iostream.h>

int main()
{
    int i = 0;

    {
        int i = 1;

        cout << i << endl
                << (::i) << endl;
    }

    return 0;
}


The output should be:

1
0

But it won't even compile.  It says that i is undeclared on the 'cout <<
i << endl' line?!  I am confused.  Was there actually an attempt to get
the scope resolution operator working or is it implemented the same as
namespaces in djgpp (in other words -- not)?  If someone could give me
an update, I'd appreciate it.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019