Beginners - October 2017 (Page 12)

Returning local automatic objects from functions (1,2)
 
I'm reading through a beginner C++ course and I got to a place dealing with returning objects from functions. This part is about overloading operators. They ...
[32 replies] Last: OK, the only valid option for me where I am is a portfolio. Internshi... (by cristian c)
If statements and functions
 
Now my assignment is to write a C++ program that prompts user to enter first character of a square or a triangle (s/t). It should then calculate area of square...
[2 replies] Last: here.For some reason area of triangle always comes to be zero #inclu... (by closed account 1vf9z8AR)
by tagerR
What's wrong with my code
 
title #include <iostream> using namespace std int main () { cout << "Olá Mundo!\n"; return 0; } Thanks in advance.
[3 replies] Last: are you using visual studio? If so thats because it will be looking fo... (by heintzman)
c++
 
i wrote a code but take a false result. how i do for its run. i have to use function in class. its 4x4 matrix multiplication #include<iostream> us...
[2 replies] Last: thanks for help but " i have to use function in class." (by conquerorbh)
by Ndutta
Reading from a txt file, saving it into a parallel array and predicting the future date
 
Hey, so as part of an assignment, I have to write a program that "predicts the date, given a day" so for example, if I want to know what date it will be 5 days ...
[2 replies] Last: Thank you Handy Andy. I'm still trying to figure it out, but I hope I'... (by Ndutta)
Can't get my return values to properly work.
 
Hello There, I am a new Computer Science student and for our first project, we are supposed to write a program that will determine if 3 given points equal a r...
[5 replies] Last: Thank You So Much! I don't have much time to work on it right now. I h... (by Mjimmie1)
vector not returning expected value
 
Good day, I am trying to use vectors and classes to write a card class an expand my experience with these. My issue is when I try and print out the whole dec...
[3 replies] Last: Dang its always something simple I'm just not seeing, thank you! (by heintzman)
why is my program crashing
 
Hi guys so I stored a file into an array of char pointer and allocated memory to it and right now Im trying to make the words lower case and I ran into a proble...
[2 replies] Last: Ah I see, yea I didnt realize that my file had words more than 16 char... (by closed account EAk1vCM9)
line of code giving me trouble
 
hi guys I have come across a line of code while studying that is giving me trouble this is the block of code #include <iostream> int main() { co...
[11 replies] Last: so for example a = some memory address that holds the string "one"? ... (by Chervil)
This is a part o a bigger program. The display function is printing the last record twice. Can anyone point out my error?
 
#include<iostream> #include<fstream> #include<stdio.h> #include<iomanip> #include<string.h> using namespace std; class Hotel { int r_no; char r_type ; ...
[4 replies] Last: Hello riona riri, Chervil has very good suggestions here. I loaded u... (by Handy Andy)
Code review. How to make my code look better.
 
Hello, the task was: I have a binary file. I need to write int values to that file and then read and print them to console using my own iterator. My program ...
[8 replies] Last: @JLBorges I appreciate it, sir. But I'm afraid that's a little bit to... (by Cppmiel)
Dice Game
 
Im so lost. Can someone please help. Im suppose to write a program that has a menu with the following options; a) Play Dice game, b) Display Odd numbers, c) Qu...
[1 reply] : First of all "newflyyera" please format your code and make sure it is ... (by Xenophobe)
Counting characters
 
Im learning how to code and I have this homework where I have to show how many of each characters of a string are in the sttring, I using this #include <...
[5 replies] Last: The approach from @AndreGS is ok, but the use of numeric codes in cha... (by Chervil)
Passing Read values from a function to another
 
I'm trying to pass all read values into a converter and have it convert each individual number into Mins/secs, but I'm not sure how to pass the Read values into...
[3 replies] Last: My conversion void convert(int songLength, int &minute, int &second... (by Garribean)
Palindrome and prime functions errors
 
So i am working with code that has to do several things. It must add all of the digits of a randomly generated integer, reverse those digits, and also determine...
[3 replies] Last: Making mistakes is ok and part of the learning process. In order to ge... (by Thomas1965)
I Need Help Please :(
 
its a vending Machine problem i need a program that displays 1. coke $1.20 2. Diet coke $1.00 3. Swiss Chocolate $1.40 4. Pulpy $1.50 5. iced coffee $1....
[1 reply] : Okay, for starters, what have you done? :) It'd be a good point for ot... (by Little Captain)
rng game
 
my program produces same number even with rand(). first 5 times running it it does 4 2 3 1 4 no matter what if i rerun program it wont get new numbers #i...
[1 reply] : You didn't create a seed. Use srand(time(NULL)); (by Hengry)
Extra newline in output
 
Hi all, I am writing simple command line programs using Visual Studio 2017 Community and compiling and linking through the Developer Command Prompt. My quest...
[2 replies] Last: Thank you for your reply. I also was trying to emulate the output in a... (by mlholder)
by sharbu
Time Limit Exceeded - Explanation needed
 
Select a pair of adjacent integers and remove the larger one of these two. This decreases the array size by 1. Cost of this operation will be equal to the small...
[2 replies] Last: Here is the problem. int min=Integer.MAX_VALUE; The assignment w... (by Cody0023)
by Sentoo
string Fraction
 
Hi peeps, mind helping me out with this code? I won't paste all the code but if need be I will post it. void Fraction::printFraction() { //So, I'm suppo...
[2 replies] Last: My project if working fine now. Thanks, Repeater! (by Sentoo)
October 2017 Pages: 1... 1011121314... 33
  Archived months: [sep2017] [nov2017]

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