General C++ Programming - November 2017 (Page 4)

Adding spaces between names in a string
 
I'm thinking this is a simple problem, but I am having a lot of trouble figuring out. I need to be able to take a string like "R2R1R2+*R1+" and add spaces to m...
[10 replies] Last: I made j and l global variables so that all my functions can have acce... (by Metalman488)
Not getting required output composition relation between classes
 
I want to display the following message: **WebPage default constructor called** **Links default constructor called** **WebPage default constructo...
[3 replies] Last: I'm not sure what you're trying to do. Your title suggests you want ... (by AbstractionAnon)
creating a function in a separate file and calling it in a source file
 
god that title's pure pish so i'm writing up a little program for a text-based game i might make in the future. it's a combat system (turn-based) and there's...
[1 reply] : i was wondering if there was a way to define the whole thing as a fun... (by AbstractionAnon)
How to print submatrix?
 
I'm trying to plot out this matrix : 11 12 13 14 0 0 0 22 23 0 0 0 0 0 33 34 35 36 0 0 0 44 45 0 0 0 0 0 0 56 0 0 0 0 0 66 in...
[2 replies] Last: #include <iostream> #include <iomanip> #include <vector> using namesp... (by lastchance)
A* Search G Score calculation.
 
I am trying to implement the A* search algorithm, and I have the follwing function to calculate the G scores for every node. Node that I assume a normal grid as...
[no replies]
calculating students average
 
hi! i am doing this for a school project and i need help with the output. this is what the output is suppose to look like but i don't know how to get their. ple...
[1 reply] : You are very nearly there. Just a couple of comments. The important on... (by Chervil)
Computes the CGPA of 200 level students
 
Please i am new to C++ programming and require your urgent assistance on the task below. Thank you. Write a C++ application that computes the CGPA of...
[1 reply] : We are not a code writing service. If you want to learn programming, m... (by Thomas1965)
error - locale name not valid
 
The following example is excerpted from Stroustrup's book: /// ... void test(istream& fin, ostream& fout, istream& fin2, ostream& fout2) { ...
[1 reply] : Locale names are implementation specific. In particular, with the GNU... (by JLBorges)
by wjcd
Is this usage of shared_ptr correct?
 
I try to use shared_ptr to manage data of several types. So I use shared_ptr to hold different data type. The code below illustrates the idea: struct MyClass ...
[4 replies] Last: > If I use std::variant<>, I also need to pass in the different data t... (by JLBorges)
Calculating GPA
 
hi! this is a school project and i need help on making the GPA 2.333333. i think the problem lies within the process data segment where it says GPA = ..... but...
[2 replies] Last: okay so under the variable declaration segment i kept the first two as... (by kristal630)
Initializing unspecified number of integers in a class
 
How can I define a class that receives unspecified number of integers? My purpose is code a program that acts similar "vector".
[3 replies] Last: this call relies on the caller to check that the passed values are co... (by mbozzi)
Matrix operation error messages
 
I am trying to do matrix : multiplication , addition , subtraction and transverse using vector ,set function and get function. i can not understand what is the ...
[11 replies] Last: Hi , the error message i am unable to figure out is : :Severity Code... (by shishir2002)
How to find Vowels, Lowercase, and Number of occurance for each letter
 
This is my first post ever, so please bear with me as I do not quite understand how to post my code the way the forum accepts it. As the title shows, I am tr...
[2 replies] Last: the <> tags when adding a post turn it to code. # lowercase... for... (by jonnin)
by stav
Compiling pure virtual functions to dll
 
Hi I'm trying to compile this code in to a dll but im getting an error. Code: #pragma once #ifdef DLL_BUILD #define DECLSPEC __declspec(dllexport) #else ...
[1 reply] : See: https://stackoverflow.com/questions/10703876/gcc-undefined-cxa-pu... (by helios)
What are some good uses for C++?
 
I'm 16 years old, and in June I jumped into programming. I'd say I'm average in both C++ and Python, although whenever I need to automate something or I come up...
[13 replies] Last: Heh heh. Whoops. (by helios)
Problem with detecting walls
 
I am a student practicing C++ programming, and I am creating a simple 2d maze game, kind of like pac-man. I ran into a problem though. When the player hits a wa...
[2 replies] Last: A wall is a wall. When you approach a "vertical" wall from the bottom... (by doug4)
readsome() on cin
 
The readsome() unformatted I/P function applied to cin doesn't seem to work properly: #include <iostream> /// cin, cout using namespace std; vo...
[6 replies] Last: > It's basically because C specifies stdin, stdout and stderr to be un... (by JLBorges)
Document program from PPP2 Chapter 20 - can't compile
 
User code: #include <iostream> #include <fstream> #include <list> #include <vector> #include "Document.h" void print(Document &d); void erase_line(Docu...
[9 replies] Last: It's saying it about the list iterator again after I made that change ... (by DragonOsman)
virtual inheritance
 
Greetings People! Is there any difference or meaning in the code below? class A{ public: void Foo() { cout << " Foo() from A\n "; } }; class B : vir...
[1 reply] : Is there any difference No. (by mbozzi)
member selector(.) versus (->)
 
I guess this is a heap/stack question: At the outset,should I write the code so an object is instantiated and accessed with the (.) member selector or written s...
[5 replies] Last: Write your code for strict correctness and readability, and your pro... (by technologist)
November 2017 Pages: 123456... 16
  Archived months: [oct2017] [dec2017]

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