General C++ Programming - September 2016

by d3v4l1
String Comparison Without STL (code review)
I have written a string comparison function. It works like I intended but I want a critic review. Took me a while to arrive at this so I'd like to know other wa...
Sep 30, 2016 at 2:19pm
[5 replies] Last: Correct. Still, it's for practice, so I don't want to make use of inbu... (by d3v4l1)
What am I doing wrong???
I keep getting some errors and I need to know what to do to stop them! #include <iostream> using namespace std; int first() { int flag; int senti...
Sep 30, 2016 at 8:07am
[2 replies] Last: Instead of a recursive approach, you could do something like this: d... (by integralfx)
inFile problems
I'm trying to do a real simple read of an inFile. I'm using a .dat file that contains "100" #include <iostream> #include <fstream> #include <iomanip> #inc...
Sep 30, 2016 at 5:16am
[13 replies] Last: The point a couple of us here have tried to make, and it seems clear f... (by closed account 48T7M4Gy)
Pointer Help
Hey everyone! I'm having trouble with this pointer assignment and I was hoping that someone could help! I have to fill in the functions that have been given t...
Sep 30, 2016 at 4:02am
[7 replies] Last: void manip1( Pointers* p ) { *p->getA( ) = 10; } [quote=Sakura... (by integralfx)
Critique for my program
Hi everyone. Just started learning C++ a few days back. Wrote this on my IDE on android for some practice on the go. Could you please provide any comments or cr...
Sep 30, 2016 at 3:38am
[2 replies] Last: Thank you! Will improve! (by Veshson)
by adbc22
Edit Arduino Code: Smoothing to average
Hello, I am trying to edit the example Arduino code "smoothing" to just take 1 average for the first 10 values and no other averages. Then I want subtract th...
Sep 30, 2016 at 3:16am
[no replies]
Need help with command line calcuator
CommandLineCalc& CommandLineCalc::operator=(const double &other) { int power = 1; int temp = (int) other; double decimal = other - (double) ...
Sep 30, 2016 at 2:48am
[6 replies] Last: http://imgur.com/3KyJu9b There are 2 items on the command line They a... (by sunday0224)
BMI calculator help
I made a BMI calc in C++, and decided I'd want to add a portion that calculates a users new BMI given a weight change weekly(say, losing 2 pounds every week, or...
Sep 30, 2016 at 2:03am
[5 replies] Last: You don't need the if statements. double GoalWeight; std::co... (by integralfx)
Generating a 12-month Calendar for any entered year!
I have a program where I am to get the user input for any year, and generate a 12 month calendar from that. I will be using the Guassian Method: w=(d+[2.6m-0....
Sep 30, 2016 at 12:29am
[1 reply] : How do I get y and c from the entered year? int year; std::cin >> ... (by SakurasouBusters)
Calculating the average of strings
So I'm practicing for a test that is coming up, and I'm stumped on one of my questions. This is a two part question, I'll include both questions first. 1) Cr...
Sep 29, 2016 at 11:26pm
[2 replies] Last: @youngldoe A void function CANNOT return anything. Change void to dou... (by whitenite1)
Conversions/void functions
Hi, I am supposed to be converting numbers from cm to inches using void functions. When I debug, I can enter the cm, but it is not converted correctly, which l...
Sep 29, 2016 at 8:44pm
[2 replies] Last: Thank you so much! this is my first time posting to the forum here. (by fclark78)
Boolean Expression
Hey guys! I am in cs124 in college so this assignment already had a template, thats why there are comments on there. Basically (i know its religious, im at a re...
Sep 29, 2016 at 7:40pm
[1 reply] : Did you write the code for this function? What you've posted here so f... (by wildblue)
I need some advice.
Hey guys, I'm a student majoring in Computer Science, and I have always had a problem understanding C++. Ever since I started my college courses I would be comp...
Sep 29, 2016 at 7:10pm
[3 replies] Last: Absolutely, get a good book and I suggest the tactic of read-to-unders... (by newbieg)
by Won
Choose from a multiset
Dear forumers, I dealing with a problem, where I need to count the number of ways that I can choose k element from a multiset. You have a set with n elem...
Sep 29, 2016 at 1:48pm
[1 reply] : > I think I could implement this as a recursive function, if the numbe... (by ne555)
by Nico
Performance while creating a string
Hello, I have a program where I need to generate and send a string if an event occurs. My initial code was something like: std::string label = "some...
Sep 29, 2016 at 12:52pm
[2 replies] Last: > It turns out the events are rather frequent and as a result I am doi... (by JLBorges)
scoreboard with efficient time ?
i want to maintain a scoreboard which contains n players sorted according to their scores, what i have done is : when player i gets x points (if he is not alrea...
Sep 29, 2016 at 12:31pm
[2 replies] Last: Maybe use a std::map. (by closed account LA48b7Xj)
Vector/Classes hierarchy issues
I have a vector which stores things of type abilities , I have a subtype from abilities called power_stab . I'm trying to use push_back(power_stab] however....
Sep 29, 2016 at 7:38am
[2 replies] Last: Ah alright thanks! I'll mark as solved. (by tristan1333)
my program compiles but does not run properly, please help!
#include <iostream> using namespace std; // Function name: get_data // Purpose: Finding perimeter, volume, area of a room // Input(s): // Output(s): perimete...
Sep 29, 2016 at 2:30am
[4 replies] Last: I was able to get my program to run properly, thanks for your help! (by Kijac10)
print using getter methods
hi everyone given below is a sample of code i am doing on my assingnment...assuming that my input is correct, can anyone help me print the 6 ID using the emp...
Sep 29, 2016 at 1:55am
[1 reply] : Here's a clue string getName(){return name;} string getID(){return ... (by shadder)
Assistance Needed In General
My name is Olivia and I am in the second part of my C++ course at college. I am either not good at programming at all, or my professor hasn't explained things w...
Sep 28, 2016 at 11:08pm
[2 replies] Last: My name is Olivia and I am in the second part of my C++ course at col... (by SakurasouBusters)
September 2016 Pages: 123... 19
  Archived months: [aug2016] [oct2016]

This is an archived page. To post a new message, go to the current page.
Registered users can post in this forum.