473,773 Members | 2,345 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

#include<iostre am> doesnt work in VC++ compiler

I tried to use #include<iostre am> in visual C++ compiler but then it
didnt work but i see this is the way it is being mentioned in C++
primer by lippman and lajoie.. where is the problem..
Do reply please.

Nov 27 '05 #1
9 6174

"nichas" <sa***********@ gmail.com> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.com.. .
I tried to use #include<iostre am> in visual C++ compiler but then it
didnt work
Define "didnt work." It works for me just fine.
but i see this is the way it is being mentioned in C++
primer by lippman and lajoie..
That's because that's the valid name for that header.
where is the problem..


Probably that you aren't reading *everything* in your book.

I'll take a guess at what's causing your problem and
tell you to look up 'std' and 'namespace'.

-Mike
Nov 27 '05 #2

nichas wrote:
I tried to use #include<iostre am> in visual C++ compiler but then it
didnt work but i see this is the way it is being mentioned in C++
primer by lippman and lajoie.. where is the problem..
Do reply please.


try:

#include <iostream>

notice the space between #include and <iostream>

-- peter

Nov 27 '05 #3

"nichas" <sa***********@ gmail.com> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.com.. .
I tried to use #include<iostre am> in visual C++ compiler but then it
didnt work but i see this is the way it is being mentioned in C++
primer by lippman and lajoie.. where is the problem..
Do reply please.


The problem is on the line 42 of your code.
Learn how to post.
Nov 27 '05 #4

"peter steiner" <pn*******@gmai l.com> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.com.. .

nichas wrote:
I tried to use #include<iostre am> in visual C++ compiler but then it
didnt work but i see this is the way it is being mentioned in C++
primer by lippman and lajoie.. where is the problem..
Do reply please.


try:

#include <iostream>

notice the space between #include and <iostream>


The space is not required (however I do use one because
I find it more readable).

-Mike
Nov 27 '05 #5
nichas wrote:
I tried to use #include<iostre am> in visual C++ compiler but then it
didnt work but i see this is the way it is being mentioned in C++
primer by lippman and lajoie.. where is the problem..
Do reply please.


Copy and past (DON'T RETYPE) the following program, then please report
back on what it tells you after you compile and execute it:

#include <iostream>

int main()
{
std::cout << "It turns out <iostream> works fine." << std::endl;
}

Best regards,

Tom

Nov 27 '05 #6
[snip]
#include <iostream>

int main()
{
std::cout << "It turns out <iostream> works fine." << std::endl;
}


almost ... std::endl is in <ostream>, but since standard headers may
include each other it may work sometimes (ok ok, it works on every
compiler i am aware of, but still ...)
Nov 27 '05 #7
nichas wrote:
I tried to use #include<iostre am> in visual C++ compiler but then it
didnt work but i see this is the way it is being mentioned in C++
primer by lippman and lajoie.. where is the problem..
Do reply please.


It does work. You're doing something wrong. Please post the code you say
doesn't work, say why you think it doesn't work, and specify which
version of Visual C++ you are using.

John
Nov 27 '05 #8
John Harrison wrote:

nichas wrote:
I tried to use #include<iostre am> in visual C++ compiler but then it
didnt work but i see this is the way it is being mentioned in C++
primer by lippman and lajoie.. where is the problem..
Do reply please.


It does work. You're doing something wrong. Please post the code you say
doesn't work, say why you think it doesn't work, and specify which
version of Visual C++ you are using.


and most important: tell us the error message from your compiler.
Usually the first 2 or 3 messages are sufficient.
--
Karl Heinz Buchegger
kb******@gascad .at
Nov 28 '05 #9
Thomas, it worked fine.. I think that the problem lies in me.. i did
complete a intermediate level course in C++ about 2years back and
things have faded away.. so i got to get through them and then only
post any doubts not leading to waste of ur time.. i will surely find
the difference in code given by you and the code which gave me the
error and i do appologize i should have provide the group with the code
and the error that emanated.. thanks again all of you and thomas you
too..

Nov 28 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
89406
by: John Tiger | last post by:
Can anybody have idea about the difference between #include <iostream.h> and #include <iostream>. Is later one valid statement on any compiler. I tried compiling on MSVC second statement give compilation error as #include expect filename. Anu help would be appreciated. thanx, John
9
2372
by: ai | last post by:
Hi , I have an application which has to read files of size few mba nd read them into array . Since i am using STL and std namespace to avoid the error error C2872: 'ifstream' : ambiguous symbol when i include <iostream.h> with std namespace and <List>
1
4572
by: ya man | last post by:
when i use #include <iostream.h> in some files i get lots of error messages of the kind 'ambiguous symbol this is solved when i use #include <iostream why is that ? and can i use #include <iostream.h> in some way examples to the error messages c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\streamb.h(90): error C2872: 'ios' : ambiguous symbo c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\streamb.h(90): error C2872:...
2
2165
by: Brett | last post by:
Hi, I'm compiling an old project under the 'new' visual studio 7.1.3088. I changed the line: #include <iostream.h> to #include <iostream> and now I get a stack of errors, some of which are:
1
1241
by: Russell Mangel | last post by:
After creating a new .NET Class Library project, I then add the header file: #include <iostream> (I tried adding in my main .cpp file and also tried in stdafx.h file.) Doesn't work, and I get the following error messages: LNK2020: unresolved token (0A000006) _CxxThrowException LNK2020: unresolved token (0A000015) delete fatal error LNK1120: 2 unresolved externals
5
2346
by: wesley | last post by:
Hi All. i am new to C++. I know that in order to use cout, i need to include <iostream>. I have done this, but i still get errors when i try to output to the screen. Is there a file that needs to reside in the same folder as the project? I know that in java, this is the case. Please help. Thank Wesley
1
2141
by: lars.uffmann | last post by:
Hello everyone! I just debugged a pretty huge project, eliminating basically every memory leak that would occur with the current configuration files, at least according to the mtrace() tool from the library <mcheck.h>. Now the very last bugs I seem to be incapable of eliminating are: - 0x000000000061f460 Free 387310 was never alloc'd 0x2aaaab053b53 - 0x000000000061f040 Free 387311 was never alloc'd 0x2aaaab053b53
1
2055
by: Old Wolf | last post by:
In a discussion elsewhere, someone wrote: #include <iostreamis not guaranteed to define std::cout, it merely has to declare it as an extern object, and declarations of extern objects do not require complete types. As far as I understand, a implementation is free to use a certain amount of compiler magic to be able to declare std::cout etc. without defining basic_ostream. Is this correct? If so, then it would mean that the following...
11
41282
by: gumboots | last post by:
Hi there guys, I've recently purchased "Sam's Teach Yourself C++ Fifth Edition" (About a week before the 6th edition came out) I'm trying to work through the book, but in trying to compile Hello World, I keep getting an error instead of it making the program. I've looked around the internet for a reason, but come up stuck. My only assumption would be that the fifth edition is upgraded to suit newer compilers? (I downloaded Visual C++...
0
9621
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10106
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10039
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6717
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4012
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3610
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2852
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.