General C++ Programming - July 2015 (Page 5)

What is the significance of the underscore _ ?
 
#include <string> #include <vector> class AddressBook { public: // using a template allows us to ignore the differences between functors, func...
[10 replies] Last: @ shadowmouse Nothing particularly concrete, just years of looking at... (by Duthomhas)
Tracking what code modifies a variable in visual studios?
 
So I have a pretty big program with a lot of stuff going on and need to find out what code is modifying the value of a certain variable. Is there anyway I could...
[3 replies] Last: Just what I was looking for! Thanks. (by hiei2071)
Inline template methods
 
I have class A that inherits template T. Template T has few inline methods. How to put all things together? Currently, I put A in A.HPP that includes T.HPP. In...
[3 replies] Last: --- removed --- (by Krogoth)
How to resize an array? (1,2)
 
Hello, I'm trying to code this little thing, don't ask about what it is or efficiency, I'm just trying to work a little with C++, and what I'm trying to do is g...
[23 replies] Last: By the way, I'm not sure who reported your post or why. My guess wo... (by MikeyBoy)
Receiving various errors, need help!
 
#include <iostream> #include <stdio.h> #include <string.h> using namespace std; const int MAX_CHAR = 100; class Student { public: Student::Stu...
[6 replies] Last: Error 1 error C2065: 'initID' : undeclared identifier C++ is case-sen... (by fcantoro)
by Won
Binary output
 
Hi! I have some hex values from a hex editor, for example: d5 57 4f ad 30 33 0b 4e 49 a7 05 18 c4 90 66 d8 45 ac 39 3e 7d f1 a8 02 80 14 20 90 6e 20 12...
[no replies]
Child virtual method isn't called !
 
COMPONENT.HPP: #ifndef KENG_OBJ_TYPES_COMPONENT_HPP_INCLUDED #define KENG_OBJ_TYPES_COMPONENT_HPP_INCLUDED #include <list> #include "../main/obj_type_id.hh" ...
[6 replies] Last: keskiverto, if you check like that, ofc. I didn't know how to do that ... (by Krogoth)
Compiler/Programmer Error?
 
I am currently making a program related to the Goldbach Conjecture, and needed some help in a particular section, the program calls this function quite often an...
[3 replies] Last: UPDATE - Problem solved! The logic just needed to be thought through... (by Pratik K)
Strings
 
What am I missing here to correctly modifiy string a? #include <iostream> #include <string> using namespace std; void change(string a) { string b; ...
[3 replies] Last: What the other guy did would require a pointer and you can do this. Yo... (by Aim4Erudite)
Need Help With Something I Am Working On
 
Okay so I play this game and there are pay sites that sell hacks and make a killing off of it, but I unearthed a hack that no pay site offers, and I have only s...
[1 reply] : Anybody have any advice or tips or anything? (by itsstino)
by olette
Popping?
 
So this is my code- #include <iostream> #include <string> #include <iomanip> #include <fstream> #include <cstdlib> #include <vector> using namespace std...
[1 reply] : What should the function 'input' do? In other words, how does it use t... (by keskiverto)
by Ceset
Static vs Dynamic Polymorphism
 
I just learned static polymorphism and was spending my time learning what it is about for last few days. We create dynamic polymorphism this way class Animal ...
[14 replies] Last: Yes it is done and i appreciate every help (by Ceset)
Error zero size array, working with classes.
 
Keep getting an error saying I have zero sized array but I have a constructor creating an array of 50. Also getting an error that says: deletion of an array exp...
[3 replies] Last: Glad to help! (by Ganado)
by olette
Not sure about the errror
 
#include <iostream> #include <string> using namespace std; class Car { friend bool operator==(const Car &carA, const Car &carB); public: Car(); C...
[3 replies] Last: You don't have implementations for any of your Car class function defi... (by Ganado)
Initializing error
 
Just learned vectors and tried to initialize one but got back error C2440: 'initializing' : cannot convert from 'initializer-list' to 'Vector<std::string>' I...
[7 replies] Last: Did you remember to #include <vector> ? (by LB)
C memory management
 
Hey my dear friends, First of all, this is a C-question, not C++ related. In my school-project last year we had to develop an application for a µC in C. I th...
[4 replies] Last: How can I force that memory_ and place_ are never touched by anyone e... (by NoXzema)
by Ceset
Static Gets Initialized!
 
I was testing out something with statics. My former experience says statics shouldnt be get initialized inside constructor. Thats why Static Constructor conce...
[6 replies] Last: It was a good question. Everybody gets stupid stuff wrong. (by Duthomhas)
Init parent's member that cannot be passed to constructor
 
I have many classes inheriting each other, like A, B::A, C::B. All of them must have an index that is never modified after object creation, and cannot be given ...
[15 replies] Last: I suggest making an enum. Boost has some pretty cool enum stuff to pl... (by kevinkjt2000)
Deleting pointer objects
 
I have a struct like the one below and I create pointer objects base on it, for example, "Node* prvNode = previous;". The creation of these objects are made in ...
[4 replies] Last: If you use "new" to create the node, you must use "delete" to delete t... (by doug4)
Diffcult with vectors and for cycles
 
I wrote the following bool function: bool user::Execute(SampleFormat& sample, const EventFormat& event) { if (event.rec()!=0) { Float_t a1, a2, a3, a4...
[4 replies] Last: Yes, I meant abs(norm(sum1) - certain_value) < abs(norm(sum2) - certa... (by whitebeard)
July 2015 Pages: 1... 34567... 15
  Archived months: [jun2015] [aug2015]

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