Beginners - July 2015 (Page 7)

Problems with Copy Constructor - Homework Problem -
 
I am having big time issues understanding the copy constructor when a pointer is involved. My code works, but then crashes at the end. I have attempted to debug...
[7 replies] Last: @Keskiverto Thanks so much. If you didnt clarify that the destructor i... (by D0CHollywood)
My total does not calculate correctly
 
The sum does not calculate correctly Hi Everyone, I'm begginer to C++. I'm trying to write a program that asks the user to input student ID,student year a...
[4 replies] Last: if(GPA>=2) total +=1; (by closed account 48T7M4Gy)
Tic-Tac-Toe Engine Bug.
 
Trying to make a Tic-Tac-Toe engine with smart computer Most things are explained in the code. 2 Player mode works just fine, 1 player mode against computer tha...
[5 replies] Last: C++ evaluates && before || so for example this: if((X == 1 && X... (by dhayden)
This is what i came up with
 
This is waht i came up with for this question. Someone mentioned that i am calculating the average before i've read any values in. What am i doing here wrong im...
[5 replies] Last: you are right (by gregorydouglas89)
A problem with if else statements
 
This is meant to be a simple program designed to write a quick "happy birthday" email to someone. It seems like there is a problem with the if, else if and el...
[2 replies] Last: Thanks! (by TheHippoCritic)
Logical Operators Comparing String if else
 
Hi! I'm taking a summer intro to computer science class and have a question on my code. I am using logical operators to write the below program. I successfully ...
[3 replies] Last: I also found that I was incorrectly comparing strings as if they wer... (by jlb)
my .exe doesnt work
 
when I run my program in the compiler it works without a problem but when I try to run the .exe file it just goes into "not responding" and then stops altogethe...
[1 reply] : You need to make sure to handle the file paths correctly. Relative pat... (by Peter87)
Difference Between For Each and Index-based Loop
 
I have two pieces of code that I was expecting to work the same and I can't figure out why they don't. First, this is the way that works how I expected: siz...
[2 replies] Last: Thanks. I think I get it now. I was only increasing i on some of the l... (by kabbotta)
How to do Hexadecimal to Decimal
 
Tryed all day to make a program that can do this and the only reason i cant is because char cant hold more than 1 digit, just wanna see what som1 else has made...
[8 replies] Last: I finally figured out how to convert hexadecimal numbers to decimals w... (by Deadlines)
help with while loops.
 
i got this code to test fstream its functions. and i am getting a error only on visual c++ console applications. is there a another way to get the while loop ru...
[4 replies] Last: Is it fixed? Working fine on Xcode. What does the errors say? (by DarkHunter2765)
Lost In Program Out Of Options
 
Looking to see if anyone has some advice for me.... I'm creating a program for class that is supposed to output the the winner of a talent show based on 5 judge...
[5 replies] Last: And what about a struct? The only problem is you would have to, probab... (by Aim4Erudite)
by slaw94
Haveing trouble with getting a function to call.
 
I'm having difficulty with my showBill function and am liking for a little insight. #include <iostream> using namespace std; void showBill(double chg); ...
[4 replies] Last: It should work like this. #include <iostream> using namespace std;... (by SamuelAdams)
How to make and control grid (2d array)
 
Im new to c++ and I want to know how to make AND control grid(2d array). If someone can explain and give me example it will be very good. I really want to know ...
[1 reply] : http://www.cplusplus.com/doc/tutorial/arrays/ (by CodeWriter)
ASCII
 
I'm trying to import a file that use ascii and get a error line invalid and it's one line any ideas why.
[3 replies] Last: Could you describe the format of this file? And also provide the code ... (by Zhuge)
Shift bit operations - LFSR
 
Hi, I'm trying to implement a LFSR (Linear Feedback Shift Register) in C++ using Shift bits operators (<< and >>) . I've been reading articles to learn how t...
[1 reply] : #include <iostream> #include <bitset> int main() { std::bitset<5... (by booradley60)
Beginning c++ through game programming code review
 
hey all so I'm on chapter 6 of this great book and one of the exercises says to redo the mad lib game using references, which I did but found it to be too easy....
[2 replies] Last: Line 95: srand() should only ever be called once during a program. C... (by AbstractionAnon)
problem with segmentation fault
 
#include <iostream> #include <cstdlib> #include <string> #ifndef TIC_TAC_TOE_H #define TIC_TAC_TOE_H class tic_tac_toe { public: void prnt(); void get...
[3 replies] Last: my problem now is how should i put in the code for that. I don't kn... (by AbstractionAnon)
Best method for sorting a struct
 
I'm new to structs and arrays. I do know how to sort a single array, but how do you sort a struct. For example: struct apartmentInfo // apartmen...
[2 replies] Last: Thank you for that explanation. That really helped me to get a better ... (by jpanther)
String Conversion Function Problem
 
Hi, I'm relatively new to C++. I was trying to make a header set of functions for easier access (this may have already been done before but I just decided to ta...
[4 replies] Last: Alright thanks, this was kind of just some testing code I wrote while ... (by Polymetric)
Polymorphism (Virtual Functions)
 
i have a question, when you define for example a virtual void parameterless function with name "F" in a class, and then you make a number of subclasses under th...
[1 reply] : Yes (assuming by subclass you meant derived class). The use of the key... (by shadowmouse)
July 2015 Pages: 1... 56789... 33
  Archived months: [jun2015] [aug2015]

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