General C++ Programming - April 2018 (Page 13)

C++ ifstream/private variable/classes
 
Classes.cpp: #include "Classes.h" Car::Car() { } int Car::GetYear() { return year; } int Car::GetSpeed() { return speed; } string Car:...
[1 reply] : Hello Im new to this. Im having trouble trying to use set and get meth... (by Thetersures)
Vector going out of bounds without giving error when triying to display
 
When i run this program, i create a vector succesfully, but in the next loop the program stops working without giving an error. when i trie to cout one element ...
[2 replies] Last: To improve readability use code tags: [co de] Your code [/co de] Rea... (by coder777)
C++ STL-like doubly linked list with constant time splicing
 
Hey, I'm looking for a C++ implementation of a doubly linked list with constant time splicing. To be more specific: http://en.cppreference.com/w/cpp/conta...
[1 reply] : I'm not aware of such an implementation but it probably wouldn't be to... (by dhayden)
how use a split complex?
 
template<typename Out> void split(const std::string &s, Out result) { std::stringstream ss(s); std::string item; while ((std::getline(ss, item...
[7 replies] Last: thank you so much. fixed like i need. #include <iostream> #include <s... (by Cambalinho)
How to retrieve the last node in a linked list?
 
Class EmployeeList javascript:tx( 'string employeeList::searchLastEmployee (nodeType<employeeInfo>* &last){ return last->data.getCode (); } string ...
[3 replies] Last: Actually, I believe that std::list maintains a pointer to the last i... (by dhayden)
recursive functions(c++)
 
I want to present you a very short and easy for most of you recursive function, I think that if you understand this function you fully understand recursive func...
[no replies]
Binary Tree : leaves and post order
 
I am having trouble getting my # of leaves method working, with leaves being defined as a node whose left and right subtrees are empty trees. The class has thr...
[5 replies] Last: When you say post order is not working, what do you mean? What incorr... (by doug4)
by KB93
Solve Sudoku Puzzle Using Backtracking
 
Hello everyone, like the title says I'm trying to finish implementing a solve function to solve a Sudoku Puzzle. So far I think I've figured out how to check th...
[1 reply] : Use bits in an integer to gather the values currently in the row or co... (by dhayden)
about for_each and functions objects
 
the for_each and functions objects are only for STL?
[2 replies] Last: i see. thank you so much for all (by Cambalinho)
by jfet97
real_array: new class template
 
Hi to everyone, I've created a new class template to replace arrays (it's only an exercise, nothing serious). The main difference is in the indexing (it's weird...
[5 replies] Last: Ops I've I completely misunderstood your hint...thanks for this explan... (by jfet97)
Arrays with structure
 
I'm studying for my finals that's at the end of the month. There is a question that goes: Construct a C++ program that interactively accepts the data below i...
[2 replies] Last: CarInfo details; // THIS LINE MAKES NO SENSE. WHY IS IT HERE? cout ... (by Repeater)
Evaluating arithmetic expressions using recursive descent parser
 
#include <sstream> #include <iostream> using namespace std; using namespace std; //const char * expressionToParse = "6.5-2.5*10/5+2*5"; const char * ...
[7 replies] Last: [quote=dhayden]But that isn't the advice you gave: I wasn't refering t... (by coder777)
how to clear stl::set constructed using placement new
 
I noticed when constructing std::set using placement new,like this std::set<int> *pSet = (std::set<int>*)new char[sizeof(std::set<int>)]; new(pSet) std::s...
[8 replies] Last: You attempt to "optimize" those small stubs with your placements. Is t... (by shadowofwind7)
by nether
non-os dependent sockets
 
Is there a way to create non-os dependent sockets in c++ and if so how would I go about doing it? Or is there something better to use than sockets? just curious...
[11 replies] Last: thanks for the input @Repeater and kbw ill take a look and ZeroMQ (by nether)
by faeory
c++ programm
 
i need urgent help programming this project ! i would be very thankful if you help me...! "Develop system scheduler program (in C++) to schedule system opera...
[1 reply] : o Input file (in.txt) has instructions, as shown in the below table o... (by zaphraud)
vector of pointers to objects
 
Hi, guys, I am doing a simulation about solar system. The simplest scenario is that containing only sun and earth. I wrote a 'Body' class first to initialize a ...
[4 replies] Last: Thank you very much! I am still learning and thank you for your reply! (by ZhixiangZhang)
Class: Non-Standard Syntax
 
I am a newbie when it comes to classes in C++, and I have to create a program that uses a class involved with retail items at a store. I have to create three it...
[2 replies] Last: Wow, I cannot believe I forgot those! I feel so dumb haha. Thank you s... (by datboi97)
how use array inicializations on constructor?
 
see these constructor: template<typename TypeID> class array2 { private: TypeID *arr=NULL; int intSize=0; public: array2(unsigned int uintS...
[9 replies] Last: C++ is not Visual Basic. You have to unlearn what you learned in VB. (by closed account E0p9LyTq)
It statement
 
#include <iostream> #include <iomanip> using namespace std; int main() { int i, rows = 0, row_nr; cin >> row_nr; //if(row_nr > 1 && row_nr <= 30) { fo...
[1 reply] : How many threads have you already created about this one program/probl... (by keskiverto)
by awad
learn by coding
 
hi guys , i need some kind of active group of learners so we can work on some projects
[2 replies] Last: any project mbozzi to apply what we learn (by awad)
April 2018 Pages: 1... 1112131415... 17
  Archived months: [mar2018] [may2018]

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