General C++ Programming - September 2018 (Page 9)

Nested Classes and Thrown Beer
 
I'm sitting in the local pub, one of my co-workers just stormed out after throwing her beer on my other co-worker. Monday morning is going to suck. The definiti...
[5 replies] Last: I would nest classes if the inner class were inherently part of the ou... (by doug4)
Understanding of the polymorphic behavior in case of custom exceptions
 
Why does the 2nd std::cout in the below code prints the "std::exception" and not "Ooops!"? As per my understanding, since ooops class is derived from std::exce...
[1 reply] : Like the comment says: throw can make a copy. The p is a std::excepti... (by keskiverto)
by elsa
Data Structures: need help fleshing out my functions
 
This assignment has me flustered with nowhere to go -- confusing to the extreme. I'm a novice to data structures, and this week's homework assignment has me los...
[2 replies] Last: Check your text book and look at what a linked list is. (by DefinitelyNotPalpatine)
Extract value from key-value pair in substring
 
Hi, I have a very large std::string (~500,000 characters) and need to extract certain smaller strings out of it (but only the value in a key-value pair). For e...
[1 reply] : Do you mean something like this? #include <iostream> #include <stri... (by tpb)
extern "C"
 
Hello everyone, maybe it's a stupid question but in interrupt handling function I can't rewrite a variable. I'm sure that the interrupt is triggered and assigns...
[3 replies] Last: initialise it first, then you'll know for sure if the ISR was called. ... (by Jaybob66)
by volang
Char array, extra garbage from buffer
 
I create an char array (my_c_array) of size 50, then I read in exactly 50 char from a buffer... Now I wonder...Why do I get extra garbage charecters when I d...
[10 replies] Last: Thanks man, appreciate it (by volang)
Creating an Application Logfile
 
I'm an inexperienced C++ novice, coding for a hobby. Class A and Class B encapsulate my data, and they contain all the public getter and setter functions for t...
[6 replies] Last: I had to make some changes because VS2017 generated a security-related... (by SimpleCoder)
problem with scope operator
 
I am having difficulty sing objects with the scope operator (::). I don't have any issues writing for (.) or (->) but I am doing something really ridiculous wit...
[2 replies] Last: I don't want to "critique" the answer but it was thorough, clear, conc... (by technologist)
Inheritance Game Class
 
So I need to make an inheritance between the USER class and the Player class; I have more classes to add but I believe that if i'm able of at least understandin...
[2 replies] Last: I think I get what you're, saying, let me see if I can do this. Thank ... (by javyesco)
How to change fonts (graphics.h)
 
Hi! I am just a beginner and this is also for my project. I just wanna know if is it possible to edit the specific word or string, font. I would like to change ...
[8 replies] Last: ohh... i see. Thank you so much sir! Sorry for being too slow. Welll, ... (by daryledevs)
log_target_->pt_->dump();
 
what is the meaning of this code? log_target_->pt_->dump();
[1 reply] : It dereferences log_target_ to get an object. Then it dereferences the... (by dhayden)
by cgm2k7
Create File.dat in c
 
olá pessoal bon dia! Venho aqui mais uma vez pedir ajuda... Estou criando um projeto, que preciso criar uma criar um arquivo binário com varais imagens ...
[16 replies] Last: help-me (by cgm2k7)
by PonasM
Merge 2 versions of a file
 
Hey guys I was just wondering if there was some kind of a library or something that would take 2 versions of a file and would make a third file with attributes ...
[3 replies] Last: Any revision control system like Git or Subversion does this. The olde... (by Duthomhas)
building a library
 
I need help to build the following 3D engine https://archive.codeplex.com/?p=hieroglyph3 using visual studio 2017, I get a lot of errors related to DirectXTK, p...
[2 replies] Last: I will telepathically understand what your problem is *BLAM* You're ... (by poteto)
neural net code problem
 
Hi all, New to coding and forum, hoping to get assistance in getting up & running with an artificial neural network code using arrays & for loops. General p...
[1 reply] : "in" is a 1x4 array which means the first index can only be 0, but you... (by tpb)
by sanlys
Overwriting array values(noob)
 
Hi i'm a total noob to c++ and programming in general. i followed some tutorials and i think i know a little bit of what something mean(lol) so i tried this ch...
[2 replies] Last: PLEASE learn to use code tags. It makes reading and commenting on your... (by closed account E0p9LyTq)
How can we serialize an arbitrary class?
 
Given this class: struct Address { string street; string city; int suite; friend ostream& operator<<(ostream& os, Address& adr) { ...
[2 replies] Last: Thanks for this simple solution. I am going to investigate boost::seri... (by JUAN DENT)
Access to base class from derived class
 
I realize this is probably a very easy question for most. However, can anyone tell me how to modify this short piece of code so that the values printed to the s...
[3 replies] Last: I want to thank you both (mbozzi and Peter87) for your answers; Peter8... (by JaJangMyeon)
by Ozzy69
Can you help me with this exercise?
 
The triangle of Pascal is a numerical triangle formed by binomial numbers (n k) where it represents the number of the line and represents the number of the col...
[1 reply] : The second condition in the if statement should be k==0 rather than n=... (by lastchance)
September 2018 Pages: 1... 789
  Archived months: [aug2018] [oct2018]

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