General C++ Programming - March 2017 (Page 2)

Default arguments in constructor
 
Hi all, I'm using default arguments in a non-default ctor to mimic the default ctor: #ifndef MYCLO...
[5 replies] Last: A default constructor is a constructor with no arguments, or a constru... (by mbozzi)
C++ 11 Generic Lambda
 
Error: parameter declared auto Error: Months was not declared in this scope I can not figure out...
[5 replies] Last: #include <iostream> #include <map> #include <algorithm> int main() {... (by JLBorges)
Issue error checking user input
 
I am having an issue with the "while" statement that checks the users input and verifies it's not a ...
[2 replies] Last: Oh!! I see it now... Thank you! (by ff210327)
by F95
Need help with linked list code for airline reservation
 
Need help writing a program for an airline reservation system that inputs and outputs the first name...
[8 replies] Last: Thanks. Everything works now. This is what the instructor was looking ... (by F95)
Threads: segmentation fault
 
Hey guys I am having issues with threads. I am trying to make a thread for my downloader funct...
[no replies]
C++ to Raptor flowchart
 
Does anyone know how to put a C++ program in Raptor form? Here is my program: #include <iostre...
[no replies]
by tushu
Detection of Cycle in graph ( wrong output )
 
int main() { char line ; int N = 5; vector<int>adj ; FILE *in = fopen("test.txt", "r"); f...
[4 replies] Last: You just focus on isCycle() function. Rest will be right as I have te... (by doug4)
Library for graphical visualization
 
There are a lot of libraries for graphical applications, unfortunately most of them go into game dev...
[2 replies] Last: what exactly do you want to draw? For debugging, can you rig your cod... (by jonnin)
Printing a number in reverse
 
Hi everyone. I was given an assignment to convert a decimal into a binary. Here is my code below, it...
[7 replies] Last: I have to admit, I wasn't expecting this many solutions. Don't know ho... (by NeonNovel)
Generate multidimensional vector on demand.
 
Hello people, Can I generate a vector whose dimensionality is defined in runtime? That is: ve...
[9 replies] Last: I would favour factoring the code into two separate functions: 1. mak... (by dariodem)
Confused
 
I've hit a roadblock and I'm not sure how to proceed, I'm writing a code that reads in a file of nam...
[1 reply] : 98: n.insert(-1, 0); You can't insert anything with an negative inde... (by Thomas1965)
by helios
Random tree pick
 
Is it possible to pick a random element from an std::set/std::map in O(log n)? It's acceptable if so...
[4 replies] Last: No, a random pick returns an iterator into the container without modif... (by helios)
calendar dates
 
I have to write a program that will list each month of the year and the day of the week that the mon...
[2 replies] Last: Give each day of the year a day number from 1-365 or 1-366 for leap ye... (by closed account 48T7M4Gy)
Need some help - stuck!!!
 
Hi guys! Trying to build a program for my assignment: Program needs to estimate the number of boxes...
[2 replies] Last: Thank you for your time! I formatted my post so it is easier to read a... (by merish5)
Need help with this homework :(
 
#include<iostream> #include "qqq.h" #include <string.h> #include <math.h> using namespace std; ...
[1 reply] : > In function 'void translate(char*,char*)': > 't' undeclared (first u... (by ne555)
Threads passing an array as an argument
 
In my main function I am trying to make a thread and pass down a string a array to it by doing this ...
[5 replies] Last: Thank you guys I fixed my mistake. This was my first time posting and ... (by krzysztof176)
Draw an Equilateral Triangle using FLTK (indirectly) (1,2)
 
I'm doing an exercise in my C++ intro book where I have to draw a series of regular polygons, one in...
[23 replies] Last: I tried it. The "square" is still coming out as a diamond and one or ... (by integralfx)
reading whole text file into one string ?
 
how to do this (whole text file by its spaces, tabs, new lines)
[2 replies] Last: thanks (by mohamedeltair)
template for multiple functions with varying arg list
 
I know C very well, and C++ fairly well. Although - with the latter - I never really had a need to u...
[6 replies] Last: By "generic code" I mean "code which accepts any type which meets a pa... (by mbozzi)
March 2017 Pages: 1234... 19
  Archived months: [feb2017] [apr2017]

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