473,396 Members | 2,158 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

#include<iostream> doesnt work in VC++ compiler

I tried to use #include<iostream> 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 6143

"nichas" <sa***********@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
I tried to use #include<iostream> 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<iostream> 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.googlegr oups.com...
I tried to use #include<iostream> 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*******@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...

nichas wrote:
I tried to use #include<iostream> 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<iostream> 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<iostream> 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<iostream> 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
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...
9
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...
1
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...
2
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...
1
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...
5
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...
1
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...
1
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...
11
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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...
0
tracyyun
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...
0
agi2029
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,...

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.