473,228 Members | 1,875 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,228 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 6134

"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: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.