General C++ Programming - June 2018 (Page 4)

which headers should i add to my new class?
 
how can i find that which headers should I add to my new class?
[1 reply] : If you use a class or function from some header, then you need to incl... (by Repeater)
i dont know how to fix need help (1,2)
 
hey im new here and sorry for my english i have small problem whit my project in school. Determination of the matrix determinant 4x4 / 8x8 / 16x16 with a ...
[20 replies] Last: i think its ok or just look ok b4 he stoped at 5222 matrix <1000000 o... (by mattryca)
error: invalid use of incomplete type ‘class
 
Hi, I wrote a new class and add it to a project but I encounter this error what is wrong with this code? error: invalid use of incomplete type ‘class Mob...
[1 reply] : what is wrong with this code? That depends on the content of the incl... (by coder777)
std::unordered_map error
 
Hey, Given these definitions: enum class ExitDirection {NORTH, SOUTH, EAST, WEST}; using RoomNumber = int; and this declaration: std::unordered_ma...
[1 reply] : So, the issue is that there is no specialisation of std::hash for yo... (by TwilightSpectre)
Program does what it's supposed to do except for the first time.
 
Long story short, I wrote a (likely needlessly complicated) program to represent 21 students pulling teams from a hat. Teams A, B, and C have 3 students each, a...
[2 replies] Last: you dont call setTeam() after you call setPull() on line 83. So as kbw... (by stav)
80% Asperges, 20% Asparagus, 100% Career Destroying. (1,2)
 
Got a code that's producing memory address of stored 24bit pixel data. I'm pretty confident I can get the 3 byte colour code, pretty easily from each memory add...
[25 replies] Last: I guess you are just a troll. Whatever. At least I get the last word! (by tpb)
redefinition of ‘class error...
 
I've encountered this error when I wrote a new class: ============================================================ error: invalid use of incomplete type ‘cl...
[2 replies] Last: I don't think the forward declaration really matter (could be wrong), ... (by Ganado)
Sorting and finding index of a vector
 
vector<int> initial={4,7,16,18,8,11,10,15,5,9,2,6,17,19,12,13,1,3,14,20}; Vector<vector<int>> allparents;//This is a 2D vector of size in which each row cons...
[1 reply] : (1) PLEASE USE CODE TAGS (2) Please consider the intelligibility of w... (by lastchance)
STL
 
vector<pair<int, pair<int, int>>> a; please explain this in detail
[5 replies] Last: I didn't say you were contradicting me, just thought it was funny. :) ... (by Ganado)
by mc0134
where to put a class?
 
In general, should class appear in .h file (sort of like normal function prototype style) and then the .cpp file would #include the .h file OR should class just...
[3 replies] Last: If you don't need to show something to everyone, keep it to yourself. ... (by mbozzi)
by jkim37
A POINTER LOST THE WAY(Marked as *)
 
I AM USING C++ with XCODE. #include <iostream> #include <stdlib.h> #include <string.h> using namespace std; struct custom{ custom* pLink; custom* pToF...
[2 replies] Last: @helios THIS IS BECAUE IT"S DOUBLE LINKED LIST. I TRIED WITH SINGLE LI... (by jkim37)
good permutations
 
This is my code for "good permutations " on codechef i am getting correct ans for test case but wrong ans on submitting https://www.codechef.com/problems/GOO...
[6 replies] Last: Thanks @lastchance for your code. My code is now working.I had missed ... (by closed account 287LhbRD)
How to count with regex.
 
This is just a thought, but if you were replacing words with regex and you wanted to count how many words you replaced then how would you do that?
[6 replies] Last: Ok thanks for the tip, I'll check them out. (by Doctype)
Extracting algorithm of an Iterative-method module
 
Dear all, I'm not familiar with vector and matrices as classes. I appreciate your help with extracting the *correct* underlying algorithm of the below modul...
[1 reply] : matrix is not a c++ thing. Someone created a matrix class. vector (n... (by jonnin)
by Borneq
How compile *.proto?
 
When I run cmake . I have errors: -- Configuring done CMake Error at CMakeLists.txt:251 (add_library): Cannot find source file: ../src/hbase/if/AccessCon...
[1 reply] : This is Google Protocol Buffer stuff, right? From memory, the protobu... (by MikeyBoy)
Return value
 
Hello! I was just "doodling" around with my xml parser. And wanted just to build some error report, incase the datafile is missing. Reading the info about Ti...
[7 replies] Last: For checking the status you often don't need a variable: if (!doc.Lo... (by tpb)
Calculate quaternion rotations between two values
 
I have a quaternion Q1: X: -0.023995593190193176 Y: -0.4076451063156128 Z: 0.04357096180319786 W: 0.9117847681045532 and I have a keyframe value Q2 which is...
[3 replies] Last: OK, so you got it? Nice! Sorry, I haven't looked at those in about 1... (by jonnin)
by jaituk
HELP PLEASE
 
This is a class exercise that I am doing. Everything goes fine without the delete pl at the end, but when I run the code with the delete, it gives me an error w...
[7 replies] Last: You have various options: - you could pass the address of the array e... (by MikeyBoy)
How to pass an object as a function parameter of another class
 
hi, I want to pass an object as a parameter to a function, the object belongs to another class and locates in MobileNode class(MobileNode.h), and the function i...
[2 replies] Last: Overall declarations , definitions , and implementations should be... (by keskiverto)
Observer pattern help THANKS
 
Am I implementing it correctly? (used for a quiz application) Observer.h: #ifndef OBSERVER_H #define OBSERVER_H #include <vector> class Observer { public: ...
[no replies]
June 2018 Pages: 123456... 9
  Archived months: [may2018] [jul2018]

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