Beginners - September 2017 (Page 12)

1st time using Class, getting garbage output & crashing
 
Hello all, I hate posting here with my questions, but I'm using this as a last resort as my head is spinning. Background: My assignment is to create a class...
[8 replies] Last: PS Ignore the comment on line 28. You can change the value to say 2 s... (by closed account 48T7M4Gy)
Find Minimum/maximum value using reference parameters
 
Make a function called minmax. It has five numbers as parameters. first three parameters are input numbers call by value. 4th parameter is a reference parameter...
[2 replies] Last: Also, instead of a chain of if-statements, you can simplify your code:... (by mbozzi)
Need help with format
 
I need help fixing the format please! It's supposed to look like this: https://www.google.com/search?tbs=sbi:AMhZZiu7PITwdGoOPw4gt-V_146FQN55I9ve5_1I7-qr4-Z4nu1...
[1 reply] : You could use the std::setw. Now it affects only the team names. Edit... (by keskiverto)
Why does my program crash? (1,2)
 
Hello! I am building a hotel program.Which is still not finished. but I encountered a problem in which the program crashes and I was wondering if someone can ...
[27 replies] Last: It still gives errors. but I will use your code as an example for a re... (by stonedviper)
Return statement in function
 
My professor says my breakCash function needs a return statement, and the function needs to be a string. The function works perfectly but a warning pops up tel...
[3 replies] Last: Or use a stringstream instead of cout inside the function. Then at the... (by Chervil)
Reversing a char*
 
I'm posting a snippet of my project that I'm currently having trouble with. In the function reverse_ I'm passing "dog", just to simply see if "dog" would rever...
[8 replies] Last: thank you so much! :) (by hibiscusleaves2544)
Is there a standalone program that I can test C++ on?
 
I am a student at college and this is my first programming class ever. All I want to know is, is there a standalone program I can put on my flash drive to test ...
[5 replies] Last: Ok, thanks again for your patience with a noob such as I, I think you ... (by NoobAtC)
Can I change the way functions work?
 
When you pass a variable to a function in a function call, the function makes a copy of the variable so that any changes made to the value of the variable only ...
[6 replies] Last: Pure functions are appropriate if all you want to do is math. The pr... (by mbozzi)
by teeper
Printing Out Arrays In Structs
 
Hey guys so I'm working on a program that requires me to build 3 structs for 3 text files(shipments, customers, orders) containing information for each struct ...
[11 replies] Last: First snippet: Line 1: Why are you passing in shipment_size? You don... (by AbstractionAnon)
typecasting
 
#include <iostream> using namespace std ; main () { int i=3,j=2; double k =static_cast<double>i/j; cout<<k<<endl; } is there som...
[1 reply] : is there something wrong on this code ? #include <iostream> usin... (by Enoizat)
Making change homework problem
 
Hi everyone, I am very new to programming, and don't know much yet. I have received a homework assignment in which I need to have a user input the total cost o...
[6 replies] Last: We have not used istreamstring yet, but I think I understand how to co... (by User55009)
change a passed by value
 
Why is it rare to change the value of an argument that is passed by value?
[19 replies] Last: > that const int* is different form int* const Read the declarations ... (by JLBorges)
by b1yku
plz help problem about multiply and divide
 
i can add and subtract but cant multiplay and divide plz help i can't figure out what's the problem // Read data using cin repeatedly #include<iostream> ...
[2 replies] Last: It might be better to use a single loop, and input an operator as well... (by Chervil)
by Kuluoz
char array function call
 
unsigned char str_1 = {0x50,0x60,0x0,0x70,0x0,0x95,0x0,0x14,0x0,0x35,0x54,0x0}; i want to pass the str_1 to some functions. if i pass the function , and chec...
[3 replies] Last: @thomas thaks for easy way to achive @cubbi thanks. you give good sug... (by Kuluoz)
Debugging Dynamically Allocated Array
 
I am in Programming Fundamentals 3 at a college and I need help debugging my program. I have been trying to for 12 hours now and I would love any help. Thank yo...
[6 replies] Last: Thank you all so much!!! I finally got it working right! (by briscoeeee)
Why does it print out garbage???
 
So right now i am tasked to print out some ASCII art. I am told to use a Char ** private variable. So I made a 2D dynamic array of pointers with it, with all o...
[5 replies] Last: Yes, thank you. I fixed the problem with your guys help. (by killerdesi)
SFML - Moving to defined point
 
Hi I have created an object that moves in a circle using sf::Transform and rotate . This takes an angle in degrees and the center coordinates which to r...
[1 reply] : There's at least one bug: std::atan2() takes the y parameter first. ... (by mbozzi)
by MrMou6
Counting in function
 
Hello, what is wrong in this function: void MinusMoney(int a, int b) { b -= money2; startas1: if (b < 0) { a--; b += 100; goto startas1; ...
[6 replies] Last: your code does not understand the 2 numbers belong together. 150 -60... (by jonnin)
Exception classes
 
Hi everybody, I am now having an issue with the exception classes on my Calculating the area program. It keeps giving me these errors: On the zeroexceptions.h...
[11 replies] Last: Lines 16 - 36 aren't part of any function. That's not legal C++. (by MikeyBoy)
September 2017 Pages: 1... 1011121314... 21
  Archived months: [aug2017] [oct2017]

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