General C++ Programming - November 2017 (Page 6)

Obtaining a file descriptor
 
Josuttis has given an example of creating a user-defined stream buffer that can be initialized with a file descriptor, so as to write to an arbitrary destinatio...
[7 replies] Last: Of course, there are many workarounds. For instance, we could first c... (by SSteven)
sorting problem only sorts sometimes.
 
This program allows the user to enter a name followed by a grade. It stores them in separate arrays then sorts them side by side. It should display in ascending...
[1 reply] : It only manages to do it sometimes.. anyone know why? Does this con... (by cire)
Really need help with Arrays
 
Okay, so I've been at this for hours, editing, deleting, remaking my code and I can get one array easily, but adding the second array is hard and driving me nut...
[3 replies] Last: Thanks for the help guys, problem solved. #include <iostream> using ... (by hardworkpaysoff)
linked list and stack
 
Hi there, I am creating a linked list and a stack. My linked list contains getters and setters. But once the program reaches the try exception handler to ...
[3 replies] Last: Hello, I didn't actually run your code, but you seem to be re-assignin... (by Ganado)
Most frequent character by using arrays
 
Hello, This is my first semester of programming so don't bash me too hard when it comes to formatting and such. I have been doing well this term but this assig...
[1 reply] : for ascii you can exploit the small size of the table (256 possible ch... (by jonnin)
New simulation game
 
Looking to create a new simulation game, it is going to be 2D and rely mainly on the interface (GUI) Which engine is going to be best to do this with? There are...
[2 replies] Last: Thank you :) I will look into it, from first glances it looks relative... (by DylanMorganx)
Difference between Fortran code and is C++ version
 
Hi all , I don't understand why this two doce give different result ... I know that Fortrn start index from 1 and C++ from 0 .. but i think that during the conv...
[8 replies] Last: C++ #include <iostream> #include <iomanip> #include <vector> using na... (by lastchance)
Array of template type
 
I am working with dynamically allocated arrays that are template type. I know it is a common practice to set declared arrays to 0, but since the type of the ...
[1 reply] : you can use the empty braced initializer in both cases but std::string... (by gunnerfunner)
Insertion into linked list not working - size is 0
 
I need help on my STL-like linked list class. Right now the insertion because it's not working. Here's the code: #ifndef LIST_H_ #define LIST_H_ template<ty...
[5 replies] Last: Actually, it turns out that erase() is fine except for the fact that i... (by DragonOsman)
shared_mutex deadlock
 
Hello. I've written a code from Anthony Williams's book - "Concurrency in action". It's a lookup table and sometimes there is a deadlock. If I replace shared_m...
[4 replies] Last: Even this simple example causes a deadlock in MSYS2. There should be m... (by OmegaDoom)
by dawny7
How to get the values of an array from another class?
 
So classB is inheriting from classA, and classA has array1 declared and values assigned to it from reading through a file. When I call array1 in classB using ...
[1 reply] : Could you please post your code as well? Might be easier to understand... (by kimchiboy03)
Arrays
 
I have generated 5 random dice value. That I have generated. Let say the 5 dice values are 2 2 4 5 6. I then add both of the similar value, i will then cin the ...
[2 replies] Last: I am actually creating this game; When the dice has been randomly roll... (by programnick)
Recursive reference issue in hashmap and list definition in implementing LRU Cache
 
Hi ppl :), I am trying to implement a LRU Cache but stuck with the recursive definition for "list" and "unordered_map". Since I am required to have a pair...
[2 replies] Last: This is an ill-formed question. Please ignore. (by kapil2905)
User defined O/P stream buffer not printing output
 
Josuttis has given an example for creating a user-defined stream buffer, by inheriting from the streambuf class. The custom buffer is then used to construct an...
[3 replies] Last: The problem in the code in the book is that in virtual int_type overf... (by JLBorges)
Code::Blocks Installation Error
 
Hi All! On installation of Code::Blocks 16:01 and trying to create a project, I am getting an error "Couldn't save project <invalid path> (Maybe the file is wr...
[2 replies] Last: Recent versions of Windows tend to limit which directories are writabl... (by jlb)
by Johnn
Really need help.
 
1. Design your own linked list class to hold a series of integers. The class should have member functions for appending, inserting, and deleting nodes. Don’t ...
[1 reply] : This is not a homework site. We won't make your homework. Give it a tr... (by goldenchicken)
Matrix vector multiplication problem
 
Greetings C++ pals! I had an excercise in my assignment to read a vector and a matrix from 2 .txt files and than write the multiplication of the vector with th...
[7 replies] Last: shouldnt it be += instead of = for p's assignment? Ok so ultimately ... (by lekfanda)
issue to compare char
 
I need to compare two characters at line 101. But even though they are equal, it does not enter at the right condition. trying ababcbaba when it tries to compar...
[2 replies] Last: Thanks! I haven't noticed those problems! (by Lucas Fiorini)
by YoniG
Get my decrypt key from file
 
Hello. I'm writing a program for encryption and decryption. I'm given a csv file which contains the key I need to encrypt and decrypt with. The file looks lik...
[1 reply] : I'm having a trouble separating the line a,r for example to text and ... (by Chervil)
how to overcome [Error] expected unqualified-id before '{' token ?
 
please help me my new user here i want to ask please answer yeah master this is my code that i make #include <iostream> #include <cstdlib> using namespace...
[1 reply] : You are missing << between "Nama menjadi =" and nama. Correct would be... (by goldenchicken)
November 2017 Pages: 1... 45678... 16
  Archived months: [oct2017] [dec2017]

This is an archived page. To post a new message, go to the current page.