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

I keep getting an error message for program
 
I am getting the following error message: assignment8b3.cpp:44:19: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'uns...
[1 reply] : Look at this snippet: for (int i = 0; i < str.size(); i++) The prob... (by jlb)
displaying text files on ncurses mode question
 
Hi I'm trying to display text files in ncurses mode sometimes it displays the right contents, but sometimes it displays some broken words like ?^Fms?^Fm. I am ...
[2 replies] Last: Ah!! i see, it works perfectly. Thank you! (by jamz123)
FLTK library and Visual Studio 2017
 
I recently upgraded from Visual Studio 2015 to 2017, and I'm also just starting on Chapter 12 in PPP2. I wanted to know how to find the prebuilt binaries for F...
[2 replies] Last: Oh, nice, it's actually possible. Thanks for the info. I was wonderi... (by DragonOsman)
Why make_shared<Object>() gives error with Object with private constructor where as new operator works fine.
 
Hi ppl :), make_shared is more efficient than shared_ptr(new Object), but why when we use make_shared for instance creation of singleton class, it giver privat...
[5 replies] Last: Thanks alot @mbozzi for this detailed reply :) (by kapil2905)
by Kmpck
2 dimensional string with random parameters question
 
Hi guys Is there a way to declare and initiate a 2 dimensional string array using variables that will be random upon each run? The issue is that the varia...
[3 replies] Last: For your array, one option would be a vector of vector of string so yo... (by Thomas1965)
by rb737
Using Graphs for a Flight Program
 
Hello Everyone, I hope you are all doing well and I want to thank you in advance for any help you can offer. I'm having a tough time with this one. I have...
[4 replies] Last: True, but there are a lot of partial solutions of it that are already ... (by jonnin)
by Kmpck
Easy C++ MessageBox question.
 
Hi guys! I know this is going to be one of those things where it turns out that it was something really small, simple and obvious but I am having trouble ma...
[3 replies] Last: THanks guys. After I made this post I actually solved my own issue but... (by Kmpck)
randomizing card decks
 
#include <iostream> #include <ctime> #include <cstdlib> using namespace std; int main() { srand (time (0)); int counter=1; string w ={"Hearts","...
[6 replies] Last: hmm ok. ıt is decreasing as (13-reamining . now i got it. another way... (by derenNil)
by tushu
How to intialize vector using constructor
 
using namespace std; static int index = 0; class neighbor { public: int dest ; int weight; neighbor( int d= 0, int w= 0...
[6 replies] Last: I would guess that the vtxMapLoc should be initialized: ... (by coder777)
by F95
airline reservations w/ Linked List help! (getting errors)
 
I need help writing a program for an airline reservation system that inputs and outputs the first name, last name, flight number, and boarding priority (Platinu...
[11 replies] Last: I cannot use your version because it doesn't follow the structure my ... (by gunnerfunner)
Storing int type inside char type
 
I was reading Bjarne Stroustrup's book on page 72 that spoke about types and declarations (Chapter 4) in sixth paragraph in second line that said: if you need t...
[6 replies] Last: Why doesn't this happen? because Int2 is parameterized on int T, so ... (by gunnerfunner)
Need help: Ambiguity problem
 
//Hi Im trying to figure out how to get rid of this ambiguity. After running the program, it states that "Person is an ambiguous base of StaffST." I know about ...
[3 replies] Last: This is a duplicate of: http://www.cplusplus.com/forum/beginner/21105... (by MikeyBoy)
need help on the ambiguous error
 
HI, after running the program, I receive an error that states, "Person is an ambiguous base of StaffST. I have no idea how to fix this. I know it has to do some...
[2 replies] Last: This is a duplicate of: http://www.cplusplus.com/forum/beginner/21105... (by MikeyBoy)
Constructor using Pointers as parameters
 
Hello everyone So I have a probleme with a constructor of a class that takes as paramters 2 pointers on that same class. I want to initialize those paramters ...
[4 replies] Last: Only obvious problem I can see with the code is that NameClasse is mis... (by Peter87)
Multi Dimensional Array Selection Sort
 
Hello, I am trying to do a selection sort of a multidimensional array based on the 2nd column in descending order. But after a number is sorted and moved in the...
[7 replies] Last: Did it! #include <iostream> #include <stdio.h> /* printf, sca... (by ehsan96696)
Need Help With a C++ Code
 
hello everyone. I am in school right now and next week my final project is due. I have the entire project coded out by two parts will not fully run for me.. If...
[8 replies] Last: What jlb is saying about code tags is: "[ code ]" Put all code i... (by pleaseINeedHelp)
Adding equations
 
Hi, so I'm working on a sequence problem for discrete structures and I have two formulas that I can use. So if user enters a positive odd n, the program has to ...
[no replies]
Code consolidation and redundancy involving templates and vectors
 
Greetings all... Below I have a sample program with the headers and cpp files listed. As you can see in the main routine, there are 5 function calls that are al...
[4 replies] Last: Very nice solution... template < Names::Enums Name > Students<Name>*... (by Non Sequitur)
How to control the function parameters via macro definitions?
 
Hi, for a project, I need to use 3 different size arrays and matrices. Actually, the project is a homework, p-median problem here: Solving the p-Median Proble...
[1 reply] : int fix = ZONE; switch(fix) or you can do it with #if type statement... (by jonnin)
March 2017 Pages: 1... 910111213... 19
  Archived months: [feb2017] [apr2017]

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