M
marco_segurini
Hi,
I am using VS 2005.
If I compile the following code only line 6 returns me an error while
line 9 returns a warning. If I comment the line 6 and debug the
program the assignments of lines {9, 11} work fine.
Why the '.' "scope operator" is accepted in line 9 and not in line 6?
thanks.
Marco.
//-----------
using namespace System;
int main()
{
double d;
d = Math.Cos(1.0); // line 6
d = Math::Cos(1.0);
d = Math.PI; // line 9
d = 0;
d = Math:I; // line 11
}
------ Rebuild All started: Project: scope, Configuration: Debug Win32
------
Deleting intermediate and output files for project 'scope',
configuration 'Debug|Win32'
Compiling...
stdafx.cpp
Compiling...
scope.cpp
scope.cpp(6) : warning C4832: token '.' is illegal after UDT
'System::Math'
scope.cpp : see declaration of 'System::Math'
scope.cpp(6) : error C2275: 'System::Math' : illegal use of this type
as an expression
scope.cpp : see declaration of 'System::Math'
scope.cpp(9) : warning C4832: token '.' is illegal after UDT
'System::Math'
scope.cpp : see declaration of 'System::Math'
AssemblyInfo.cpp
Generating Code...
Build log was saved at "file://e:\Project C++ NET
2005\Prove\scope\scope\Debug\BuildLog.htm"
scope - 1 error(s), 2 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
I am using VS 2005.
If I compile the following code only line 6 returns me an error while
line 9 returns a warning. If I comment the line 6 and debug the
program the assignments of lines {9, 11} work fine.
Why the '.' "scope operator" is accepted in line 9 and not in line 6?
thanks.
Marco.
//-----------
using namespace System;
int main()
{
double d;
d = Math.Cos(1.0); // line 6
d = Math::Cos(1.0);
d = Math.PI; // line 9
d = 0;
d = Math:I; // line 11
}
------ Rebuild All started: Project: scope, Configuration: Debug Win32
------
Deleting intermediate and output files for project 'scope',
configuration 'Debug|Win32'
Compiling...
stdafx.cpp
Compiling...
scope.cpp
scope.cpp(6) : warning C4832: token '.' is illegal after UDT
'System::Math'
scope.cpp : see declaration of 'System::Math'
scope.cpp(6) : error C2275: 'System::Math' : illegal use of this type
as an expression
scope.cpp : see declaration of 'System::Math'
scope.cpp(9) : warning C4832: token '.' is illegal after UDT
'System::Math'
scope.cpp : see declaration of 'System::Math'
AssemblyInfo.cpp
Generating Code...
Build log was saved at "file://e:\Project C++ NET
2005\Prove\scope\scope\Debug\BuildLog.htm"
scope - 1 error(s), 2 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========