Hi,all
I have code like the following lines, but when I compile this program I
got a: error C2563 : 'ios' : is not a class or namespace name!
//--Code starts here
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <iomanip>
... ...
fstream fFile;
fFile.open("c:\testfile.dat",ios::binary|ios::in,0 );
fFile<<"XXX";
fFile.seekp(dwBlockSize,ios::beg);
//--Code ends here
ERROR OCCURED --error C2653: 'ios' : is not a class or namespace name
Could anybody tell me why, thanks a lot
Joseph 3 16316
I have code like the following lines, but when I compile this program I
got a: error C2563 : 'ios' : is not a class or namespace name!
//--Code starts here
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <iomanip>
I assume you've got 'using namespace std;' here somewhere?
... ...
fstream fFile;
fFile.open("c:\testfile.dat",ios::binary|ios::in,0 );
fFile<<"XXX";
fFile.seekp(dwBlockSize,ios::beg);
from the documentation it seems that ios is legacy. you should ios_base:
file.seekp( 0, ios_base::beg );
--
Kind regards,
Bruno van Dooren br**********************@hotmail.com
Remove only "_nos_pam"
Bruno van Dooren [MVP VC++] wrote:
> I have code like the following lines, but when I compile this program I got a: error C2563 : 'ios' : is not a class or namespace name!
//--Code starts here #include <iostream> #include <fstream> #include <cstdlib> #include <iomanip>
#include <iosfwd>
>>
I assume you've got 'using namespace std;' here somewhere?
> ... ... fstream fFile; fFile.open("c:\testfile.dat",ios::binary|ios::in,0 ); fFile<<"XXX"; fFile.seekp(dwBlockSize,ios::beg);
from the documentation it seems that ios is legacy. you should ios_base:
file.seekp( 0, ios_base::beg );
ios is a typedef for basic_ios<char(which is derived from ios_base),
so it should work fine with ios (or certainly std::ios), as long as an
appropriate header (<ios>, <iosfwd>, or, bizarrely, <bitset>) is included.
Tom
Yes, thanks a lot!
"Bruno van Dooren [MVP VC++]" <br**********************@hotmail.comдÈëÏûÏ¢
news:eA**************@TK2MSFTNGP03.phx.gbl...
> I have code like the following lines, but when I compile this program I got a: error C2563 : 'ios' : is not a class or namespace name!
//--Code starts here #include <iostream> #include <fstream> #include <cstdlib> #include <iomanip>
I assume you've got 'using namespace std;' here somewhere?
> ... ... fstream fFile; fFile.open("c:\testfile.dat",ios::binary|ios::in,0 ); fFile<<"XXX"; fFile.seekp(dwBlockSize,ios::beg);
from the documentation it seems that ios is legacy. you should ios_base:
file.seekp( 0, ios_base::beg );
--
Kind regards,
Bruno van Dooren br**********************@hotmail.com
Remove only "_nos_pam"
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Al Cadalzo |
last post by:
I get the compile error:
"The type or namespace name 'Net' could not be found"
on this line of code:
Net.HttpWebResponse resp = null;
Here are my using directives:
using System;
using...
|
by: Matthew Louden |
last post by:
using System.Data;
using System.Data.SqlClient;
//etc...
SqlConnection conn = new SqlConnection(connString);
SQLDataSetCommand myCmd = new SQLDataSetCommand("select * from Test;",
conn);...
|
by: Rookie |
last post by:
I have two C# VS .Net 2003 projects that compile and
execute correctly on their own.
I would like the second project to launch from within the
first project. Therefore, I added the second...
|
by: kd |
last post by:
Hi,
I am new to C#. I have created a console C# application. For some reason,
Console.Writeline is showing an error - "The type or namespace name 'console'
could not be found".
Only the...
|
by: Richard |
last post by:
Hi All,
I am using Visual C++ .Net to create a windows forms application and I am
getting the following errors when I do a MessageBox::Show in my Form1.cpp
file:
Form1.cpp(19): error C2653:...
|
by: Jin |
last post by:
Hi there,
in CLRconsole program, i met error message
: error C2653: 'MessageBox' : is not a class or namespace name
regards.
|
by: tuanhoanganh |
last post by:
My program has class's name same namespace 's name.
Ex
namespace clsvoucher
public class clsvoucher
..........
end class
end namespace
Can I use Dim a as clsvoucher or I must use Dim a as...
|
by: Atul Thombre |
last post by:
Hello,
I am developing an application in C# using VS2003 for mobile device.
This application is using .Net compact framework.
I have added a reference to a third party library I am using for...
|
by: asmx126453 |
last post by:
Hey guys i Hope somone can help i have bin looking on the internet but i cant solve it here is the code where i get the error
#region Web Form Designer generated code
override...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |