General C++ Programming - March 2018 (Page 12)

Printing contents of vectors in a linked list
 
Hi there, I'm still working on the same family tree program and converting it into a linked list (next improvements will be virtual functions); but I'm having t...
[1 reply] : void Male:: displayWifeChildren (string p1) { familyNode* newNode... (by ne555)
loops and answers
 
Im having trouble setting up a loop where an answer got is used again next in the loop.Can anyone write any simple code of your choice for me Thanks.or maybe 1*...
[1 reply] : int answer = 1; for (int i = 1; i < 11; i++) { answer = answer * i... (by Repeater)
Please help my getgpa function is not reading data
 
Hello guys, my GPA function is not reading data from the courses. I can't find a solution. I'll be glad if any of you help me. #include <iostream> #inclu...
[4 replies] Last: how can i pass that student to the function? (by jhonx234)
Displaying the maximum sums of subsequences and its subsequence values
 
Hi I made this program expecting it to return the maximum sums of subsequences of the given integer array but also returns/outputs the actual subsequence where ...
[2 replies] Last: Oh I commented that part in the code I don't remember why (by ratteng)
QT installation problem
 
Hey guys I'll start of by saying I'm new tp qt.I decided to try download qt,its something that has interested me for a long time but only now am I getting into ...
[no replies]
Why is this not reading as a sting?
 
Hi all, It's been a while since I've programmed in C++ but the below: ifstream fin("SMX_Test.csv"); assert(fin); vector< vector<string> > SM_Invoice; vector<...
[2 replies] Last: Might be easier to create a struct for the data and use simple vector.... (by Thomas1965)
Please explain this program
 
Can somebody explain this program line by line in simple words i am new to c and c++ so i just know about basics i want to know about the keywords and functi...
[3 replies] Last: ip.type = INPUT_KEYBOARD; ip.ki.wScan = 0; ip.ki.time = 0; ip.ki.dwE... (by Thomas1965)
Merge a linked list with another linked list O(1)?
 
I am supposed to merge one linked list with another linked last so that the first linked list is empty. My prof want's it to run in O(1) time but how is that po...
[5 replies] Last: Apparently "merge" as in "concatenate", "append", or "transfer content... (by keskiverto)
by Chaost
Detect numeric keys with few statements
 
I have to detect key input from the keypad (1-9) as well as whether CTRL/SHIFT/ALT was held down at the same time. I'm currently using multiple GetAsyncKeyState...
[2 replies] Last: That's the solution I ended up with, seems it's the tidiest way to acc... (by Chaost)
Err C2228 - Possible Most Vexing Parse?
 
Hello I am trying to recreate a system I made in Python. Here is the error I am getting: error C2228: left of '.onPoison' must have class/struct/union Here...
[3 replies] Last: Thanks guys. Just figured out the problem a little bit before the resp... (by Dish5oap)
Mirroring 2D array across diagnol
 
I am trying to mirror an array. This is the array I am given 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 and I need to transform...
[4 replies] Last: ok, so you want to mirror arcoss the top left to bottom right diagonal... (by jonnin)
program running out of memory?(crash)
 
Hello guys I am making a kind of snake game where you hit a piece of fruit your score gets incremented but I still have to implement the snakes body anyway I h...
[11 replies] Last: I suppose the GNU crowd thought that it would not be politically expe... (by adam2016)
Double Variable Evaluating to True
 
Hi! I am working on the following for an assignment, but I keep returning the same error "Line 33: the address of 'double billingAmount(int, int, int)' will alw...
[3 replies] Last: @Kloppite and @lastchance thank you! I did not realize that the way in... (by coloure)
by stav
Invalid use of incomplete type
 
Hi I have two calsses: MyObject and MyLogic MyObject inherits from MyLogic but MyLogic needs to have a reference to MyObject. So i forward declared MyObject ...
[2 replies] Last: oh, of course. Yeah i think i will try to rethink my design again T... (by stav)
Small library providing getters/setters
 
Hi guys, I've written a small library, allowing you to simply add getter/setters to existings variables, with minimal change in basecode. https://github.com...
[5 replies] Last: @doug4 I would change std::function<void(T &, T const &)> _setterFunc... (by marco91)
C++ Classes (issue)
 
Hey guys so I've been trying to gain some understanding of classes by creating a OOP program in one file that creates a player with custom or prior attributes. ...
[3 replies] Last: If I may give a piece of advice, you may want to look into overloading... (by Lehti)
Brute Force Program Error on for loop
 
// Can someone run this program on C++ compiler: I'm getting an error on this // for loop on line 101 and I can't figure out why? //Error Message: Brute_For...
[1 reply] : int i,j,r,c; printf("Enter number of rows\n"); scanf("%d",&r); prin... (by jonnin)
Can't read all lines of file
 
I have a program that is supposed to read from a file, parse it, then output the results. I can't get getline to work, and I've tried every variation I can find...
[5 replies] Last: Thanks JLBorges, I was able to fix it after checking the file. (by jmoore201897)
Scan function
 
My main is below, I have gotten this far but do not know how to implement funciton scan0. In my directions it says this, "The function scans word starting from ...
[2 replies] Last: Fascinating, The function scans word starting from bit startingBit, t... (by keskiverto)
by EvanH
RK4 for getting the position of a particle, and then animating it
 
Hi everyone, I'm relatively new to C++ but I know the basics. I want to use C++ to integrate equations of motion using a Runge-Kutta method because I know it...
[1 reply] : I would think that Vulkan or opengl is what you want: https://vulkan-... (by coder777)
March 2018 Pages: 1... 101112131415
  Archived months: [feb2018] [apr2018]

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