Beginners - October 2017 (Page 4)

I must be blind or something
 
Just doing some sample test. I came across this. Weird thing is, I remember doing this same snippet before, and I had no problem. Did CERN mess up reality or ...
[7 replies] Last: > So << is a sequence point now? The concept of sequence points was ... (by JLBorges)
modular functions and nested looping?
 
For class i'm supposed to write a program that: asks for five scores, finds the min and max, and finds the average after subtracting the min and max. Its suppos...
[2 replies] Last: thanks, i got it figured out in a really overly complex way though XD... (by iWillAlwaysBeANoob)
Help comparing strings to make a standard output
 
I have a project where I am making a conversion table, part of the requirement is to have a standard output for unit type regardless of the input. I am trying ...
[10 replies] Last: Hi, For std::transform, have a look at the example here: http://en.c... (by TheIdeasMan)
by Bizzy
Input/Output operator overloading
 
Hey, so I've never handled i/o operator overloading before and yet my beginner's course expects me to know how it works. I need to implement the top 2 functions...
[2 replies] Last: Awesome, thanks! (by Bizzy)
by cash
array menu
 
I need help with options 6 and 4 in the menu. This is the menu : 0. Create array: Asks user how many numbers to fill (the length of the partially filled ...
[no replies]
How to call vectors from function?
 
#include <iostream> #include <vector> using namespace std; vector<float> avesum(float d) { vector<float> v; cout << "please enter numbers: "; while (cin >> ...
[1 reply] : Hello redstorm98, Welcome to the forum. PLEASE ALWAYS USE CODE TAGS ... (by Handy Andy)
Multiple input in a do while loop cin for int
 
Hello. I have this code: int a; int b; do { cout << "set a to: "; cin >> a; cin.clear(); cin.ignore(); } while (cin.fail()); do { cout << "set b ...
[5 replies] Last: Thanks for the thorough explanation. I just have to practice using thi... (by holydiver)
What's wrong with my code?
 
First semester of programming. I am stuck on an assignment. Please ignore the averages and stuff at the very bottom, will look at that later. What I am worried ...
[3 replies] Last: EDIT Sorry, never mind. I did what you suggested then, I copied my cod... (by Cristina54)
How good is this code, speaking of good coding and optimization for a newbie?
 
Menu.cpp #include<iostream> #include"suma.h" #include"resta.h" #include"multi.h" #include"mensaje.h" #include"div.h" #include"cuadricula.h" usi...
[1 reply] : In no particular order: using namespace std; is dangerous. Putting ... (by Repeater)
how to pass variables in function parameters
 
I've learned that using non-const variables in file namespace is bad practice (and of course I don't want to develop bad habits). However, I'm not sure how I'm ...
[6 replies] Last: Ok thanks! Got it down now everything is working as expected! the lea... (by freshii)
HELP ME!!!!
 
this is my homework for tomorrow and i don`t now how to do it PLEAS HELP write a c++ program to output vertically ten consecutive numbers to a file. the file ...
[6 replies] Last: You don't need the string string amjad_alghamdi; , I suggest remove t... (by Chervil)
by Rostam
Nested loops exercise
 
So I can't seem to find the reason why when i input one into this program, it prints the "-" repeated until the compiler quits. I've spot checked all my loops t...
[1 reply] : Let me know if you see anything I missed! Line 7 double sum; sum i... (by Chervil)
something wrong
 
my first and second array can be displayed perfectly; but there is something wrong with the third one; for the third one, i am trying to display the differenc...
[3 replies] Last: #include <iostream> #include <iomanip> #include <valarray> using name... (by lastchance)
Loop help with functions and input/output text files
 
So I have an assignment to write a program that reads from a text file, manipulates the data, then inserts the manipulated data into an output file. The program...
[1 reply] : One suggestion is to open both input and output files in main(). Pass ... (by Chervil)
Help on LAB 3.3 answer keep coming 0 " Working with String Input and Type Casting"
 
// Lab 3 percentage.cpp // This program will determine the percentage // of answers a student got correct on a test. // PUT YOUR NAME HERE. #include <iostream>...
[1 reply] : totalPoints = ( numCorrect/numQuestions); This is doing integer div... (by Chervil)
std::map
 
In std::vector there a fucntion call push_back is there something equivalent to that in std::map
[3 replies] Last: std::map also offers an overload of operator for insertion: # incl... (by gunnerfunner)
Bounding Box Collision
 
I am trying to figure out how to calculate all sides of the rectangle. I am struggling finding the bottom and right side of the two. Can anyone help me? bool...
[3 replies] Last: Collision detection algorithm solution copied from: https://stackoverf... (by Enoizat)
cout not working after While statement
 
Feel free to critic any part of the code, but the problem im having is that the cout at the end is not working after the while statement. #include "s...
[3 replies] Last: I had a palm to face moment. realized that the "while (monthdue > 0)"... (by brenton393)
l can't get the 'exact' decimal part of a float number
 
Hi all, l have a serious issue here. lm trying to get the decimal part of a float number; then l want to transform that decimal into an integer. The issue...
[3 replies] Last: you can use integers for this, with a great deal of effort to compute ... (by jonnin)
Help me please! do while / if else, with char isn't working.
 
hey you people, let me know where is the fault. //opdracht_4.15_7 #include<iostream> using namespace std; int main() { char ch, s; int telm = 0, t...
[5 replies] Last: why is the: 'using namespace std; dangerous? knowclue’s answer is... (by Enoizat)
October 2017 Pages: 123456... 33
  Archived months: [sep2017] [nov2017]

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