General C++ Programming - November 2016 (Page 2)

by gmm796
Linked Lists
 
Im having some trouble with linked lists. I am supposed to create two linked lists that both contain eight nodes. The first list has a pointer called uno and th...
[no replies]
by mbozzi
Avoiding stack overflow from deeply-nested destructors
 
I have a relatively large DAG (several million nodes). Since each node has (shared) ownership with its children, the stack is overflowing when large sub-graphs...
[4 replies] Last: I think in my case I'll be able to get away with increasing the stack ... (by mbozzi)
fatal error LNK1169: one or more multiply defined symbols found
 
Keep getting following error and I do not know what is cause it: 1>ProgrammingAssignment3.obj : error LNK2005: "struct node_2 * beginning" (?beginning@@3PAU...
[1 reply] : Term.h, line 21. You are defining a variable in a header. (by PanGalactic)
by Gyiove
weird matrix multiplication results (eigen)
 
Eigen::Matrix<int, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> test(3, 2); test << 1, 2, 3, 4, 5, 6; Eigen::Matrix<int, Eigen::Dynamic, ...
[2 replies] Last: oh god, thank you so much. I checked my calculations so many times, ju... (by Gyiove)
Is it possible to obtain the type of the first parameter of a lambda?
 
Hi, I have the following lambda: auto selectViaCategory = ( const std::string& categoryName, const shared_ptr<CreditCardStatementLines>& lines) { r...
[5 replies] Last: ...or template<class F, decltype(std::declval<F>()(""s, nullptr))... (by Cubbi)
bayesian classifier
 
hi everyone I have to classify whether a given person is a male or a female based on the measured features. The features include height, weight, and foot size....
[1 reply] : Did you write this program yourself? If so I am sure you can explain i... (by gunnerfunner)
Trying to Write a HTTP Request Parsing Function in CS Course
 
In my CS course on edX, I need to write four functions that the staff wants us to write in a server implementation code written in C. One of those is parse() w...
[no replies]
how to compare words in c++
 
i am asked to remove duplicated words from a text and write to a new file in c++. I am some ideas but just don't konw how to write it out. I want to compar...
[6 replies] Last: You need to store two strings at the same time. Read one word at a tim... (by Chervil)
Code Blocks
 
Good morning. I am new to programming and "Code Blocks". I wrote a program and want to compile and run it, but it says I have an invalid compiler/debugger. A...
[6 replies] Last: No. As long as you chose to use the GNU GCC compiler while setting up.... (by boost lexical cast)
C++ Code Outline
 
Can you give me the outline for a code. I want to count the number of girls and boys entering a exam hall. This counting i am planning to do through swipe machi...
[2 replies] Last: Improved version on Stewbond's code (aside from changes in style and o... (by boost lexical cast)
by helo12
I am getting a no match for operator error and need help hunting it down.
 
///////////////////////////////////////////////////////////////////// main.cpp #include <iostream> #include "StringTree.h" using namespace std; i...
[5 replies] Last: However I do not necessarily understand why that changed or fixed thi... (by Chervil)
Issues with set precision
 
I am writing a program on Mac that compares costs + tax(6.5 %) I choose something that is $5.00 plus .325 tax. Whenever i use cout<<setprecision(2) to only dis...
[3 replies] Last: setprecision() affects the way the number is displayed, but it doesn... (by Chervil)
Writing from text file to multi-dimensional array.
 
What I'm trying to figure out is if it's possible to write a chart with numbers and words into a two dimensional array. I have this in my text file: Nam...
[3 replies] Last: Maybe have a struct/class holding the name and exam scores? struct S... (by integralfx)
input the numbers of characters in a string
 
I was trying to resolve this activity with differents methods but I feel that I 'm so closing. thank you the Out put expected is number of characters: 13 en...
[5 replies] Last: Thank you!!!!!!!! It works perfect!!!! (by kevinros)
Searching text file with prefix
 
I have a text file with a name/place on each line. Is there a simple way of searching the text file based on a prefix entered by user and printing every line th...
[2 replies] Last: Read the entire file line-by-line. If the line starts with the prefix... (by mbozzi)
Operator precedence in C++...
 
Explain the expression. 3/2*2. compiler display a result 2. How is it possible the result...
[9 replies] Last: Hi all Thanks for your valuable solution.. (by r 4 raja)
class and strings
 
I am trying to write a text file but I am getting an error with the "open.file" for the Lat_name() function. #include<iostream> #include<string> #inclu...
[1 reply] : PLEASE use code tags, it makes reading your code much easier. You can... (by closed account E0p9LyTq)
Signatures for functions accepting functions as parameters
 
std::for_each requires a function that accepts a single parameter of some type and returns void. However, its implementation actually doesn't require a type o...
[3 replies] Last: Even with std::function, templates are the better way since std::funct... (by Cubbi)
Class and delete function
 
Hi everyone, i am working on this assignment and there are something i dont understand 1st:Change the push function. It will take a parameter that is a Car by c...
[no replies]
Searching text file with prefix
 
I am writing a program that reads in a text file that has a name of something, and a weight associated with that name and and stores it in a linked list and sor...
[no replies]
November 2016 Pages: 1234... 23
  Archived months: [oct2016] [dec2016]

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