General C++ Programming - September 2017 (Page 10)

Pointers and a problem to solve with them
 
Hello, I have a question regarding pointers, the written code and wish to understand where I might be doing it wrongly as I'm not getting what I'm supposed to. ...
[19 replies] Last: Thank lastchance & kemort. Now I have two programs working. (by aurimas13)
general fx callback question
 
Does a callback function in c/c++ require monitoring in a loop to keep it alive, or can one "fire and forget" by having it interrupt when triggered without bein...
[1 reply] : It depends entirely upon the event mechanism. Some callbacks require r... (by Duthomhas)
Access element of Vector
 
Dear all, I use this code in my research, vector<RoutingPacket> bufferAggregate; class RoutingPacket: public::cPacket {} class LeachRoutingPacket: public::Ro...
[19 replies] Last: eureka... this code, changing *netPacket (remove the encapsulated pac... (by elisatih)
please help with switch loops
 
So i am trying to have the user input a letter, then use a switch loop to determine what number on the phone keypad the letter corresponds to. Then i want to p...
[2 replies] Last: @wildblue hahaha shit idk how i fucked that one up thank you (by asdfcxz)
PPP2 Chapter 16 Exercise 8 - Help Needed
 
You can find the code on the PPP Google Group, here: https://groups.google.com/forum/#!topic/ppp-public/2_B1w8V0DKw . I've attached the .cpp file and also the ...
[no replies]
How to read from file in c++
 
myFirstfile.txt has 4 numbers 4 5 6 7. I am not getting any output. Instead I am getting blinking cursor. I want the numbers from file as output. Please help ...
[2 replies] Last: Thanks. got it. (by shivamjain1)
Simpson's rule question
 
Hey guys, I know that Simpson's rule has to be applied for even n rectangles, however in my assignment I am asked to calculate in 7 rectangles between a = 0 and...
[14 replies] Last: Thanks again kemort. (by aurimas13)
Want to learn Everything in c++
 
hey ? i am new here and i hope this thread wuld be in the right section , the purpose of this thread was umm i know its a dumb question to ask but i really wan...
[2 replies] Last: Thanks for the reply buddy :) and also for the links repect + (by UmairAli)
Need help with simple programming
 
write a C++ program that will calculate the miles per gallon a car gets given the gallons of gas used and the total miles driven. Assume that the car holds 15 ...
[15 replies] Last: Why do you keep deleting your code? It makes this thread useless as a... (by MikeyBoy)
Creating a recurring number program from a file (Soon to be more)
 
Howdy guys, This is the first time ive posted in cplusplus.com, and im quite glad i've gotten this far (Since learning a new program is fkn hard). The program...
[4 replies] Last: #include <sstream> int data_2 {0}; std::stringstream i... (by closed account 48T7M4Gy)
Need Help Searching Array
 
Menu driven program. Function is to allow the user to enter a fruit type and display the price. Data is loaded into the arrays from a text file and I have alrea...
[4 replies] Last: @aneurysm http://www.cplusplus.com/forum/beginner/220979/ Don't dupl... (by closed account 48T7M4Gy)
\t giving more space in c++
 
Why is the output showing more space between the words "10 years" and "15 years" despite giving only single \t as between other words. #include<iostream> us...
[7 replies] Last: I used setw to add spaces manually and got the desired output as shown... (by shivamjain1)
How can I test that a construct must not compile?
 
Hi, Say we have a three element maximum MPL style sequence (as in the tiny type in the book C++ Template Metaprogramming). I want to place a test that fails (r...
[6 replies] Last: I'm guessing a bit: # include <type_traits> # include <utility> tem... (by mbozzi)
Not getting any error messages but...
 
my output is completely wrong! I'm totally not sure why this is or how to fix it.. #include <iostream> #include <iomanip> #include <string> using nam...
[2 replies] Last: ... (by ne555)
Counter object that declared only in the base class but used in every derived class separately.
 
Suppose I have a class which represents kind of protocol for other classes that inherited from it: //Protocol.h class Protocol { protected: //each...
[9 replies] Last: But if I chose to increment counter inside the constructor of each cl... (by mbozzi)
For loops: definition of int as local or global
 
Dear all, I am creating a class, for which some methods include loops and double loops of the form: for (int i = 0 ; i < L1 ; ++i) { ... do_some_cal...
[2 replies] Last: Great, that answer the question. Thank you for the reply. (by Tontonbaboum)
Qt Sound problem
 
Hello again, I'm now working with Qt to develop GUI application. My current project is a cross-platform timer application. The GUI prompts the user to set...
[5 replies] Last: Executing qmake helped to build the EXE, but QSound doesn't play the s... (by olfibits)
by Kiryu
My code is a mess
 
Hey, as the title suggests, I have a problem that often holds me back from continuing my projects, and that is my code! Before I continue, the most important...
[no replies]
Cannot get correct output from separate file.
 
Please if possible can anyone improve my code. This project is due in two days time. So basically what I need is: 1. for users to input the item they want and ...
[5 replies] Last: See that's the problem I know for sure there is a problem within my co... (by ArchRon1n)
Metric tons program
 
I know this form says no home work aloud but I need help I can't figure this out. The program I'm trying to make is that it need to prompt the user to enter the...
[6 replies] Last: What are you confused about? It's a user input and printing out comput... (by Hengry)
September 2017 Pages: 1... 891011
  Archived months: [aug2017] [oct2017]

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