cout Questions

5

Solved

This might be a beginner question and understanding how cout works is probably key here. If somebody could link to a good explanation, it would be great. cout<<cout and cout<<&cout ...
Theocritus asked 20/9, 2011 at 17:17

3

Solved

I compiled on Ubuntu a program that was developed for (and works on) Windows. On Ubuntu, I see this code: string s = values_[9]; cout << s << endl; cout << s << "x\n"; pr...
Rundlet asked 10/8, 2011 at 20:49

4

Solved

Hopefully a simple question: cout seems to die when handling strings that end with a multibyte UTF-8 char, am I doing something wrong? This is with GCC (Mingw) on Win7 x64. **Edit Sorry if I wasn'...
Singband asked 5/8, 2011 at 9:3

3

Solved

Possible Duplicate: Read a password from std::cin I don't work normally with the console, so my question is maybe very easy to answer or impossible to do . Is it possible to "decoupl...
Glean asked 1/8, 2011 at 13:23

2

Solved

If I had a simple class with two variables, x and y, and a function ToString() that returns a formatted string with the data. When I call cout << simpleClass << "\n"; anyone know a ...
Complaint asked 21/7, 2011 at 1:30

7

Solved

From http://www.cplusplus.com/reference/iostream/cout/: By default, most systems have their standard output set to the console, where text messages are shown, although this can generally be redi...
Reed asked 22/6, 2011 at 23:59

1

Solved

I have a variable of type LPTSTR, which I print to std::cout with <<. In an ANSI system (don't know exactly where it is determined) it worked fine, it printed the string. Now in a Unicode sys...
Patmos asked 3/5, 2011 at 17:35

2

Solved

When answering this question, I came across this code... #include <iostream> int main() { int const income = 0; std::cout << "I'm sorry your income is: " < income; // this is lin...
Biles asked 14/4, 2011 at 15:27

1

Solved

Recently I had a problem with porting a Windows application to Linux because of the wchar_t size difference between these platforms. I tried to use compiler switches, but there were problems with p...
Oskar asked 10/4, 2011 at 12:39

1

I was wondering how std::cout is able to use << as it does. My main puzzlement is with whether std::cout as an instance of something. Basically, how is << defined? If I do this for a c...
Farrison asked 1/4, 2011 at 3:33

2

I am trying to print results in 2 nested for cycles using std::cout. However, the results are not printed to the console immediately, but with delay (after both for cycles or the program have been ...
Sportswear asked 25/3, 2011 at 20:15

4

Solved

Is there a way in C++ to check if an ostream object is cout or a ofstream object? Something like: ostream& output(ostream& out) { if (out == cout) return out; else { out << "so...
Johnettajohnette asked 23/7, 2010 at 13:49

5

Solved

Given a string of unknown length, how can you output it using cout so that the entire string displays as an indented block of text on the console? (so that even if the string wraps to a new line, t...
Tannenberg asked 12/3, 2011 at 5:49

3

Solved

I'm using a class meant to be used like this: Output() << "Hello.\n"; In its operator<< I explicitely use std::cout, but I'd like to have a static class member that resolves to `std:...
Genie asked 22/2, 2011 at 17:47

8

Solved

class Address { int i ; char b; string c; public: void showMap ( void ) ; }; void Address :: showMap ( void ) { cout << "address of int :" << &i << endl ; cout <&lt...
Tremblay asked 1/2, 2011 at 9:19

2

Possible Duplicate: What does the “c” mean in cout, cin, cerr and clog? Can someone please explain to me what cout stands for?
Pickwickian asked 4/2, 2011 at 18:47

5

Solved

I have some code that, in its smallest complete form that exhibits the problem (being a good citizen when it comes to asking questions), basically boils down to the following: #include <string&...
Reisman asked 3/2, 2011 at 6:9

3

Solved

Is there any way to make this run faster and still do the same thing? #include <iostream> int box[80][20]; void drawbox() { for(int y = 0; y < 20; y++) { for(int x = 0; x < 80; x...
Pap asked 25/1, 2011 at 2:13

7

Possible Duplicate: Should I use printf in my C++ code? If I just want to print a string on screen, I can do that using those two ways: printf("abc"); std::cout << "abc" <&...
Upstairs asked 24/1, 2011 at 12:13

4

Solved

today when I was working on some code of mine I came across a beeping sound when printing a buffer to the screen. Here's the mysterious character that produces the beep: '' I don't know if you can ...
Ceballos asked 15/1, 2011 at 19:25

1

Solved

Possible Duplicate: C++: “std::endl” vs “\n” I'm wondering if there is any significant difference between these two ways to print newline : cout << endl...
Freedman asked 22/12, 2010 at 18:55

3

Solved

Is it possible to change text printed with "cout"? I would like to make it show the current percentage of something without having to have a new line for each percentage. Is this possible?
Uri asked 8/12, 2010 at 14:34

7

Solved

In ANSI C++, how can I assign the cout stream to a variable name? What I want to do is, if the user has specified an output file name, I send output there, otherwise, send it to the screen. So some...
Sauncho asked 9/1, 2009 at 16:5

2

Solved

Possible Duplicates: printf vs cout in C++ cin or printf?? I've always wondered about printf and cout.. which one is ultimately faster, and is it the most flexible as well (ie can pr...
Blazon asked 4/9, 2010 at 20:6

5

Solved

So I have a function that looks something like this: float function(){ float x = SomeValue; return x / SomeOtherValue; } At some point, this function overflows and returns a really large negat...

© 2022 - 2024 — McMap. All rights reserved.