Beginners - April 2016 (Page 14)

Help with struct program
 
Hello, trying to get back into c++ but I'm having a hard time. Getting errors with me struct variable usage on lines 31 and 33,and I'm not sure why. Advice woul...
[1 reply] : division .quarter is OK (returns a double) division .quarter .sale... (by Norm Gunderson)
Cannot assign member data
 
Can anyone tell me why I cannot assign the data to the members in class?\ Those underline parts are red on the line in compiler. # include <iostream> # inc...
[1 reply] : Members of a class are private by default (i.e. cannot be accessed... (by Norm Gunderson)
Coding a small leveling system
 
Hello, I am making a small textRPG and I would like to know how to make a leveling system and gain new attacks and moves that can lower defense, and if there is...
[no replies]
Using vectors to create a list of sorted books and altering inventory.
 
My main concerns vary widely for this program. One issue is creating lists among two cpp files and a header file. For one I can't seem to grasp the concept of p...
[4 replies] Last: Book::Book(string bt, int bq, double bp) { title = bt; quantity = ... (by Super3Preme)
by aar3y5
sometimes runs, sometime doesn't
 
Writing a basic rock paper scissors. problem occurs when C++ skips the switch case randomly. Sometimes it will run 5-9 times before skipping, sometimes it wil...
[2 replies] Last: So changing line 13 to " int cChoice = (rand()%3);" should net me valu... (by aar3y5)
Reversing an array
 
I was given this problem for my class: Write a program in C++ that asks the user to enter an array of size N and pass the array to a function named reverse_arr...
[4 replies] Last: Y'all were both helpful! Thank yo very much! (by brendancostner)
Need to make a function for user input validity
 
I have a menu driven program where the user can enter the number 0, 1, 2, 3, 4, 5, 6, and -1 that corresponds to functions to do things with a random number tha...
[3 replies] Last: You are having a scope issue. I looks to me that your validInput funct... (by nsidaris)
Find lowest number w/ Function
 
I am having trouble getting the lowest number to display. Everything else works fine and the entire program works fine when not in a function. I'm assuming th...
[2 replies] Last: I got to work. I put max = 0 and min = 100 in int main () and it work... (by govCode)
recursion why i am having this problem
 
//I am new to programming and having a problem with this code, I want to return the string if read back-words is in fact a palindrome. I am having an error on t...
[2 replies] Last: It works perfectly just removing the for loop inside main, probably so... (by dean)
How to get the sum of the columns in the array
 
For the program I had to pull the information for the first 4 columns from a file called BusInput.txt with this in it. 111 100.00 200.00 50.00 222 200.00 300.0...
[7 replies] Last: Thank you! I will get to work on that right now! (by travina8)
From Integers to Strings Array from File
 
How can I change this code from integers to strings? How to alter code reading string of arrays from file? #include <iostream> #include <f...
[3 replies] Last: Is this correct? Probably not. It looks like you got in a muddle, s... (by Chervil)
Question with arrays
 
Hello. Im taking my first programming class and we have a project involving arrays. These are the concepts that the project wants us to cover. - Reading dat...
[2 replies] Last: thank you. (by Ghostman513)
Need help adding score to this slot machine
 
I need help showing the user their points when they press 'n' to stop playing the slot machine, but it always displays "0" as the score. Any pointers? #inclu...
[1 reply] : Line 83, 85-87: These are function declarations, not function calls. ... (by AbstractionAnon)
Problem with ifstream, iftream gives same number
 
Hello Guys, I am currently trying to read out a csv file with 16 columns and 10000 rows. The most values are between 100 and 1000. Values above are not of inte...
[3 replies] Last: Thank for trying to help me. I was actually able to solve it. The valu... (by Jarmikala)
by carten
WxDev standard library
 
Hello, I am new to this forum and have some C++ experience, but it is quite a while ago. Due to a number of reasons, I am currently forced to translate a cal...
[2 replies] Last: Thanks! That was it and sorry for such a ridiculous question! (by carten)
read data from a file and input into array
 
Write your question here. Hello, Can someone please show me how I can print out a second column of values (array) to supplement my first column in my "Use...
[3 replies] Last: I tried my best.. { int number; //Variable to hold each number... (by alexexcl)
by xai34
Test Average Program
 
Trying to make a test average program that gets data from a file(names and score), puts it in an array and calculates using data from the array. How do I acces...
[2 replies] Last: I need to pass the data from the file to arrays, what loop do I use? ... (by xai34)
Linker error?
 
I have three different files for the test class I am trying to use.. The first one will be the main prog7.cpp, the second one with be the implementation, gamecl...
[2 replies] Last: Are you sure you're actually compiling both .cpp files, and linking to... (by MikeyBoy)
Scoring Deck of Cards
 
I know this is an old problem, but cant seem to find the help needed as most people are using vectors, in which our professor hasn't taught. I have accomplished...
[5 replies] Last: You have the right idea with bool functions for each possible hand. W... (by AbstractionAnon)
by mmgh
definition of implicit copy constructor is deprecated
 
Hello, I have a compilation error definition of implicit copy constructor for 'MyClass' is deprecated because it has a user-declared destructor [-Wdepre...
[1 reply] : > Is this related to C++11? Yes. By default, a class has 5 operatio... (by JLBorges)
April 2016 Pages: 1... 1213141516... 43
  Archived months: [mar2016] [may2016]

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