library for cout question


 
Thread Tools Search this Thread
Top Forums Programming library for cout question
# 1  
Old 04-10-2010
library for cout question

Hi I am running Ubuntu 9.10 and I use QtCreator for my C++ Programms.
I knwo that in wondows OS cout is located in iostream.h library.
It seems that it isn;t the same library in Qtcrator... Smilie
Anyway, iostream.h doesn't exist and iostream (without the .h) exists but doesn't seem to include the cout command
( the qt comes with an error "cout was not declared in this scope" )

I need help because everywhere I see in the net everybody uses either iostream.h or iostream....
SmilieSmilieSmilieSmilieSmilieSmilieSmilie
# 2  
Old 04-10-2010
cout isnt in the global namespace, its rather in std... so use std::cout

or u can have some using directive likeusing namespace std
# 3  
Old 04-10-2010
so i'll use std:coout as I would use cout itself?
and in which library?
iostream or iostream.h ??
# 4  
Old 04-10-2010
yes, u cud jus use std::cout << "Hello\n";

use <iostream>, BTW its not a library, its just a header, ur Qt Creator IDE knows which library to link against to create the final executable...
# 5  
Old 04-11-2010
Data

ok ty
u rock

---------- Post updated 04-11-10 at 07:33 AM ---------- Previous update was 04-10-10 at 03:06 PM ----------

hmm all see to be alright but p, li { white-space: pre-wrap; } endl;
is not recognized as it was with simple cout Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Programming

Concatenate integer and space/newline for cout in C++

I'm trying to print out integers and space/newline for a nicer output, for example, every 20 integers in a row with ternary operator. In C I could do it with:printf("%d%s",tmp_int, ((j+1)%20) ? "\t":"\n"); but could not figure out the equivalent in C++: cout << ((j+1)%20)?... (4 Replies)
Discussion started by: yifangt
4 Replies

2. Programming

Missing cout

Heyas Me trying some C.. cout in specific, thats what i remembered: #include <stdio.h> // -- Just the above or with all the below ones, no change #include <stdio_ext.h> #include <stdlib.h> #include <wchar.h> //#include <iostream> // I assume its the same anyway? //#include <iostream.h>... (2 Replies)
Discussion started by: sea
2 Replies

3. Linux

Linux Shared Library build question...

I'm a bit new to Linux systems programming. I've been programming at the systems level for over 20 years on various other platforms, but I'm not as familiar with the GCC toolchain as I'd like to be (but I'm learning quickly)...;)... Our target is an ARM-based Linux Embedded system. We're using... (3 Replies)
Discussion started by: jcossette
3 Replies

4. Linux

./configure problem for libsf library due to apparently missing libdb library.

Hello, ./configure script fails to configure libsf. Please check the following last few lines of configure script error. checking for db1/db.h... no checking for db.h... yes checking for dbopen in -ldb1... no configure: error: No libdb? No libsf. But find command shows the following; ... (4 Replies)
Discussion started by: vectrum
4 Replies

5. BSD

Question: OpenBSD command line for checking list of library used by daemon

Hi All, I would like to ask what is the command line on OpenBSD which able to be used to check the list of library which used by specific daemon? For example, I would like to check what are the libraries which are used by ftpd. Thank you in advance. Regards, Stefan (2 Replies)
Discussion started by: lcxpics
2 Replies

6. Programming

std::cout and gfortran print*, don't output to the screen

I am not sure where to post this other than here. I am trying to figure out why an app gives different output when compiled under Ubuntu 10.10 and CentOS 5.5. I am pretty sure that the issue is that the Cent version has gcc 4.1 installed, while Ubuntu has gcc 4.4. I am trying to print from some... (20 Replies)
Discussion started by: LMHmedchem
20 Replies

7. Programming

"cout = outFile" is not compiled

Hello, Compilation of the line "cout = outFile" throws error "Error: std::ios_base::operator=(const std::ios_base&) is not accessible from std::ios ::operator=(const std::ios &)." outFile is declared as "static ofstream". Thanks, Shafi (3 Replies)
Discussion started by: shafi2all
3 Replies

8. UNIX for Dummies Questions & Answers

cout doesn't print everything

Hi all, I implemented a C++ program and successfully compiled and ran on my laptop. However when I copy my code to another machine (school's sun machine), it didn't run properly. I can compile and run, but cout does not print everything. I used cout in a loop where it iterates no more than 20... (5 Replies)
Discussion started by: SaTYR
5 Replies

9. Programming

curses (ncurses) library question

Hi again. I'm using the curses functions simply to output data to the screen in certain areas. Very simple, just using the full screen, no windows. The problem is that I'm calling mvprintw from within several child processes in the same session, and the output is going bananas. ie, no... (1 Reply)
Discussion started by: TelePlayer
1 Replies
Login or Register to Ask a Question