Beginners - February 2017 (Page 27)

cola machine
 
looking for a better way to write this I know I can use functions for each area and I am doing that next but want to know if there is a better way to write this...
[1 reply] : Yea you can use else if(){} on that and from personal preference i'd r... (by ExSanity)
by bmc
Looking for a suitable container
 
Hi, I'm looking for the best suiting std:: container to replace my poorly written own. Mine works for now, but I think it might be wise not to invest time into ...
[5 replies] Last: Thanks for your input guys. There is definitely some reading to be don... (by bmc)
Yes or no loop help
 
Trying to figure out how to loop this code with using the const int maxchar = 3; instead just using yes or no to determine because it works but if you use any w...
[7 replies] Last: it would be == "y" but that would work. y is a variable. 'y' is a ch... (by jonnin)
Java LOBBY
 
I found this website(cplusplus.com) to be very helpful with c++ question but, now I am teaching myself Java. Is there any website similar to this one that can a...
[2 replies] Last: Also a nice place to get answers to java and other non-c++ questions i... (by Hirokachi)
payroll
 
what's wrong with my program?.I'm just first year student u know..hehe..just a lil' help..please? # include <stdio.h> # include <conio.h> # include <stdlib....
[4 replies] Last: Hello mischie, what's wrong with my program?.I'm just first year stu... (by Handy Andy)
which is the best practice (if any)
 
Hello again, Trying to understand program execution I first compiled the following : (as found in my text book) #include <stdio.h> #define MAX_GR...
[9 replies] Last: Errors and issues aside, there is no best practice on what loop or log... (by jonnin)
Linked List Error
 
I'm currently getting a Syntax error on my code and I'm unsure of what the error means and where or why it may be occurring. Error- /tmp/ccYtaeHG.o: In fu...
[3 replies] Last: If possible. add the node to the beginning of the list instead of the ... (by dhayden)
Tired of Unresolved externals :(
 
I am tired of Unresolved externals error this is my code What is the matter I dont understand??? this my my source https://www.dropbox.com/s/9n6ywtnbti07djm/MYC...
[3 replies] Last: I will download a zip or code off the web but it must compile without ... (by jonnin)
how can i reverse a string???
 
is there any function to reverse my string???
[6 replies] Last: if you want to understand HOW to do it the cplusplus link also carry... (by gunnerfunner)
Labeling rows and adding total column
 
I am currently taking C++ class and we have this homework that we have to do. I have been working with my classmates and I am trying to figure out how to label ...
[2 replies] Last: @whitenite1 thank you! I didn't know that, I actually thought it would... (by dullerthandull)
pointers to structs vs -> to structs
 
Personal contribution. Just to show that for example (*p).x and p -> x can be used for the same purposes proving that they give the same output. // E...
[3 replies] Last: @Yatora: this site is to encourage folks to learn, if you think it's "... (by gunnerfunner)
Counting the occurences of different letters within a file
 
Hi guys, I'm trying to make a program that can read a file, check each 'character', record the frequency of each character, then print the character that is mos...
[10 replies] Last: Thanks for the advice guys :) Particularly Mantorr22, that fixed the i... (by schmiischmoo)
shooting a ball based on angle
 
Hi, i am currently trying to shoot a ball off a cannonbarrel into the air controlled by using angles and a fixed speed, however it hasnt been working for me. fo...
[4 replies] Last: The PI /180.0 is a constant so you should make so: constexpr doubl... (by TheIdeasMan)
by mitty
store variable and print-out
 
I am brand new to c++. I want to store variable and print out them #include<iostream> using namespace std; int main() { float store ; int i; int mynum; i...
[1 reply] : for(i=0;i<mynum;++i) { cout << "IN ASCENDING ORDER: "; ... (by Hengry)
Reverse an array elements
 
I don't understand why size is divided by 2 for the second function ? #include <iostream> #include <algorithm> using namespace std; void example1...
[4 replies] Last: Interesting. I have never been in a situation to use size/2 for revers... (by Kourosh23)
Adding at the end of a For loop
 
I can't get the variable netval to add the val variable after each for loop. As it is, the output of this is simply the last value I input into the program ...
[6 replies] Last: > Though that gives me a very large number. Initialise netval Tip:... (by JLBorges)
Compiling error for templated class
 
I am compiling my code using g++ main.cpp LinkedList.cpp Node.cpp -o project This is the error I am getting. I am unsure what it means. /tmp/ccDE0c2e.o: ...
[1 reply] : It would appear that either you have not defined Node<T>::Node and ... (by JLBorges)
Calling a function in main from a templated class
 
I am trying to call my 'run' function from my LinkedList.cpp file. This is what I've done so far #include <iostream> #include "Node.h" #include "L...
[7 replies] Last: I solve this issue. I had an undefined pointer in my LinkedList class.... (by parkhill)
Mean and Standard deviation
 
I have a textbook exercise challenge that I am currently working on. The directions are as follows: Write an interactive c++ program that outputs the mean and ...
[5 replies] Last: Thank you so much for all of your feedback. Greatly appreciate it. Af... (by cristina999)
Can't figure out why user input isn't showing up in program.
 
I am having trouble finding out why user input is not showing up in the program after it is entered and the menu comes up. The program asks the user to input a ...
[no replies]
February 2017 Pages: 1... 2526272829... 37
  Archived months: [jan2017] [mar2017]

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