Error in reading Console

  • Thread starter Thread starter Amrro
  • Start date Start date
A

Amrro

Hi,

I am trying to use a old written code by one of my senior, It is a console
application to append two files. I need to make some necessary changes in
the application, but when I try to write Console::ReadLine(), its throwing
some error

d:\Projects\myappend\append.cpp(252): error C2653: 'console' : is not a
class or namespace name,

I don't know what is wrong in this and why such errors are occurring in the
code.

Please help me, which library I need to use? if there are any changes in
project properties then please let me know.

Thanks a lot
Amrro
 
Amrro said:
Hi,

I am trying to use a old written code by one of my senior, It is a
console application to append two files. I need to make some
necessary changes in the application, but when I try to write
Console::ReadLine(), its throwing some error

d:\Projects\myappend\append.cpp(252): error C2653: 'console' : is not
a class or namespace name,

I don't know what is wrong in this and why such errors are occurring
in the code.

Please help me, which library I need to use? if there are any changes
in project properties then please let me know.

It sounds like you're trying to use .NET classes in a native (unmanaged) C
or C++ application. How does the existing code write to the console? Look
for calls to printf(), fprintf(), puts(), fputs(), or use of the C++ object
cout or cerr (or std::cout or std::cerr).

If the original code is unmanaged, you're probably better off making your
changes unmanaged as well rather than trying to bolt on some managed code
for a minor modification.

-cd
 
I am trying to use a old written code by one of my senior, It is a console
application to append two files. I need to make some necessary changes in
the application, but when I try to write Console::ReadLine(), its throwing
some error

d:\Projects\myappend\append.cpp(252): error C2653: 'console' : is not a
class or namespace name,

I don't know what is wrong in this and why such errors are occurring in the
code.

Please help me, which library I need to use? if there are any changes in
project properties then please let me know.

Check a case please. Not a 'console', but 'Console'.
Make sure you have 'using System;' statement at the top.
 
Back
Top