FIX: C1001 in MSC1.CPP Line 730 When Using Cout
PSS ID Number: Q106401
Article last modified on 02-01-1994

7.00

MS-DOS


----------------------------------------------------------------------
The information in this article applies to:

 - Microsoft C/C++ compiler for MS-DOS, version 7.0
----------------------------------------------------------------------

SYMPTOMS
========

The sample code below generates the following error when calling cout:

   test.cpp(13) : fatal error C1001: INTERNAL COMPILER ERROR
   (compiler file 'msc1.cpp', line 730)
   Contact Microsoft Product Support Services

Version 8.0 of the compiler generates the correct error:

   error C2674: '<<' : no acceptable conversions from
              'overloaded function type' to
              'class ::ostream_withassign '

RESOLUTION
==========

Create an object of class A and use that instance for the output, or
make the value that you want to print out static.

STATUS
======

Microsoft has confirmed this to be a problem in C version 7.0. The
problem was corrected in version 8.0.

MORE INFORMATION
================

Sample Code
-----------

/* Compile options needed: cl test.cpp
*/
#include <iostream.h>

class A
{
public:
  A()
  { cout << "x" << x << endl; }
  int x;
};

// A a;                // Solution

void main()
{
  cout << A::x << endl;
// cout << a.x << endl;      // Solution
}

Additional reference words: 7.00 8.00
KBCategory: Prg
KBSubCategory: CLangIss

=============================================================================

Copyright Microsoft Corporation 1994.
