cout Questions

2

Solved

I decided to try Visual Studio 2012 Express today. First thing to do was to write "Hello world!" application, however, I couldn't make it work. I created a Windows console application project, wrot...
Lorineloriner asked 31/1, 2013 at 12:36

3

Solved

I have seen people output different strings together by using both "<<" and "+". cout << firstname << lastname << endl; versus: cout << firstname + lastname <&l...
Minded asked 17/1, 2013 at 22:58

1

Solved

The cout statement in this for loop: for (vector<Student>::iterator qw = students.begin(); qw != students.end(); ++qw){ Student a = *qw; name = a.getName(); regno = a.getRegNo(); std::c...
Rebirth asked 12/1, 2013 at 16:36

2

Solved

Possible Duplicate: Convert a double to fixed decimal point in C++ Suppose , I have double a = 0 and I want to print it as 0.0000 . I've tried this : cout.precision(4) ; cout<&...
Cicisbeo asked 5/12, 2012 at 16:58

3

Solved

I can't realize how could it be possible to print a string this way without any complaint by the compiler: std::cout << "Hello " "World!"; In fact, the above line works exactly like: std:...
Genseric asked 9/10, 2012 at 13:59

3

Solved

As in this question is said, there is some differences between negative and positive zero in floating point numbers. I know it's because of some important reasons. what I want to know is a short co...
Chrono asked 21/9, 2012 at 18:35

3

Solved

I have a program where I use cout to emit debug information. The code is executed in the initialization of a static global variable, i.e. quite early in the program execution. When I use my own bui...
Cannibal asked 7/9, 2012 at 13:3

2

Solved

I am getting an error when I try to output the return value from one of my methods: Error: No operator "<<" matches these operands. Operand types are: std::ostream << std::string Mai...
Dowland asked 2/9, 2012 at 20:14

2

When I construct a boost::options_description instance like options.add_options() ("double_val", value(&config.my_double)->default_value(0.2), "it's a double"); and later want to have th...
Tandi asked 14/11, 2009 at 17:22

2

Solved

Every time I send a char to the cout object, it displays in ASCII characters unless I cast it to an int. Q: Is there a way to display the numerical value of a char without an explicit cast? I rea...
Cymar asked 28/6, 2012 at 0:54

1

I want to provide a tab-like capability for C++ text output streams. The feature should allow me to say "note this position", then allow multiple insert operations, and finally allow me to say "add...
Brescia asked 23/6, 2012 at 2:50

3

Solved

I am curious if std::cout has a return value, because when I do this: cout << cout << ""; some hexa code is printed. What's the meaning of this printed value?
Protectorate asked 11/6, 2012 at 20:35

7

Solved

I am confused about scanf's behaviour in the following program. scanf appears to input once, and then not input again, until a stream of characters is printed. Below in a C program #include<s...
Laws asked 7/6, 2012 at 16:3

3

Solved

I want to see source code of STL std::cout function. I looked at iostream, but I've seen only "extern cout". So, I guess that it's defined somewhere in the library. I downloaded source code from o...
Any asked 20/5, 2012 at 19:7

2

Solved

In C++, when I am using std::cout like that: std::cout << "myString" << std::endl; Is there anything that will be allocated on the heap by std::cout? Or will std::cout do everything ...
Cheder asked 23/4, 2012 at 17:41

2

Solved

My computer science professor wants us to find the declaration of cout. I've compiled a simple Hello world program using g++ and the -E parameter. Here's what my hello.cpp looks like: #include &lt...
Brunhilde asked 11/3, 2012 at 4:14

1

Solved

I'm working with some multithreaded code for a game project, and got a bit tired of sorting through the stdout vomit created by two threads using cout for debuging messages at the same time. I did ...
Cesura asked 2/3, 2012 at 2:21

4

Solved

Possible Duplicate: How to stop C++ console application from exiting immediately? I am trying to see my results, what do I do to my code so I can see if what I did is correct? #inclu...
Agalloch asked 28/1, 2012 at 6:24

2

Solved

Possible Duplicate: Unexpected order of evaluation (compiler bug?) I couldn't predict the output for this program : #include<iostream> using namespace std; int *p(int *a) { (...
Candent asked 2/1, 2012 at 19:12

4

Solved

I'd like implement class MyCout, which can provide possibility of automatic endl, i.e. this code MyCout mycout; mycout<<1<<2<<3; outputs 123 //empty line here Is it possibl...
Infiltrate asked 14/12, 2011 at 18:52

3

Solved

Issue I'm getting no output from a simple cout, whereas a printf will always print the number: std::cout << variableuint8; // prints nothing printf("%u", variableuint8); // prints the numbe...
Humpage asked 9/11, 2011 at 13:31

3

Solved

How can I print a character N number of times using std::cout without looping? Is there a way to move the text cursor back to nullify the effect of std::cout << std::endl;? i.e. to move up a...
Ciscaucasia asked 25/10, 2011 at 23:46

2

Solved

Does anybody know if there is a trick to toggle all the cout << functions to not print out visible output? I am trying to hack together some code written by me and some other people to put to...
Debris asked 11/10, 2011 at 3:13

4

Solved

I have something like: int8_t value; value = -27; std::cout << value << std::endl; When I run my program I get a wrong random value of <E5> outputted to the screen, but when I...
Roxana asked 28/9, 2011 at 18:29

1

Solved

I need my program to behave differently, depending on whether the output is to a terminal or to a file. How can I find this out from within C++? I assume there is no solution that works for all op...
Asphyxiant asked 25/9, 2011 at 21:56

© 2022 - 2024 — McMap. All rights reserved.