I posted this code in another question: I intended to convert u8string to a user-preferred locale before printing. But in this answer to that ...
I posted this code in another question: I intended to convert u8string to a user-preferred locale before printing. But in this answer to that ...
I have a general question about sending commands and data through Windows pipes. It seems that this problem does not happen on Unix operating systems. ...
I have this code: It gives me this result: title: text: -X-, where -X- is place, when user can write something. I have tried the other way too: ...
I'm implementing a few very specific I/O streams, one of them, an input stream that has data available only sometimes (think about some kind of socket ...
I have built this code to output a binary file containing a look up table for a multiplexed 7 segment display. I an a pretty new to coding but am lear ...
TRAMS is an inter-college cultural fest of famous Engineering college. The students from different colleges, who are participating in the cultural fes ...
I have just started learning cpp and one thing that is really confusing me is #include <iostream> or #include<vector>. Some people say tha ...
I've been tasked to add 2 user input values using object-oriented programming in C++. I've been trying to use cin inside the main and outside the ma ...
I'm new to C++. Whenever I try to compare a string and a string from a vector, it gives me an error. I included two examples below. Why does this happ ...
I've newly started learning C++ and am stuck with this problem. I need to insert a (user inputted) number of elements in a single line with space sepa ...
If I create a class: If I modify the class thus: However, if I try to call: I will get a page full of compilation errors that begin with: ...
Why doesn't this compile? It works fine if I don't wrap the class in a namespace. It also works fine if I change operator<< to SomeMethod. ...
I try #include <iostream> #include <fstream> #include <vector> using namespace std; vector<string> readLines(string filenam ...
I am a newbie learning C++ to read or write from a file. I searched how to read all contents from a file and got the answer I can use a while loop. ...
In my code, I didn't call any std::flush or std::endl, but the hello's are printed before the 2 seconds delay. I am expecting to print all the hello ...
I wrote a set of functions to print out an address in my libaddr library (see addr.h header). I am easily able to test the erase_event by changing on ...
Here's is an example: It will print me this: But I want this: How I can do it with IO manipulators without setprecision()? Why without? Becau ...
Why can't I access private functions of class Box in ostream& operator<<(ostream& out, const Box& B){cout << B.l << " " ...
I'm working with a custom vector, and currently the code looks like this: I want to change from using hard-coded values into using a .txt file that ...
Why does this function: returns with some garbage character at the first line? I believe this is the reason why I get shader compilation errors ...