Beginners - April 2018 (Page 11)

Inheritance Set and Get Functions
 
I'm trying to have my get and set functions with inheritance to work but I'm not sure what to do, here is my code. #ifndef lab10_h #define lab10_h #in...
[2 replies] Last: Are you really assigning ‘nullptr’ to std::strings and ‘NULL’ ... (by Enoizat)
by flacg
sum and average in multidimensional array
 
Working on an assignment. The requirement is to had a multidimensional array with 5 rows and 5 columns. The end goal is to have the program output the sum and a...
[3 replies] Last: I’m sure you’ve already read here: http://www.cplusplus.com/forum/... (by Enoizat)
Reading file into a class array
 
For my homework assignment, I have to create a class titled "Book" and I need to read a file, of a max size of 2000 lines, line by line into the class type belo...
[1 reply] : The first thing I see is two main() functions, one inside the other. T... (by jlb)
Odd and Even program
 
Write a C++ main function that takes and validates a positive integer number between 99 and 999999 to compute and display the following: Sum and count of eve...
[7 replies] Last: Points of interest: - Slightly more descriptive variable names help, e... (by icy1)
Minesweeper Program?
 
So I'm currently working on a Minesweeper program, and I feel like I'm getting pretty close...the one problem I'm having is figuring out how to display the amou...
[7 replies] Last: I'm unsure what the variable "m" is that you mentioned The "m" stoo... (by tpb)
Arrays and text files
 
I need to write a program that reads integer values from a text file and stores them in separate arrays. The contents of the text file is.. 1,3,-5 4,-2,-1 (no s...
[17 replies] Last: Thank you all for your responses. The program itself looks so simple w... (by parallx)
Validate Integers and Accept only if with a certain range
 
I have written this block of code and I don't seem to understand why it is not working. I have tried using a while statement and if statement but that has not w...
[4 replies] Last: Yep that worked thanks all for helping out. I don't like that extra ... (by GhettoBurger)
Dynamically resizing an array
 
I have an assignment involving functions and pointers. It's better to just paste what I am supposed to do: a. Create a function called resize that can be used...
[6 replies] Last: @keskiverto -- Guess I got lucky in the online compiler implementation... (by icy1)
by bubby
Else statement showing up upon making choice in choiceOne_Path
 
The else statement in the second choiceOne_Path (the walking bit) is showing up upon choosing 3. I am extremely new to coding and barely know what I'm doing. ...
[2 replies] Last: Hello bubby, For being "extremely new to coding" I will point out som... (by Handy Andy)
Program that counts syllables and displays them on a table
 
I am a beginner and I am learning C++ for the first time. I am having difficulty with some homework, the program is asking me to count the syllables of a word...
[5 replies] Last: Never mind, I figured it all out! Thank you for your help, I really ap... (by Jorge626)
Having trouble understanding linked list/pointers
 
This is a function that deletes the first element in the linked list void List::removeStart() { if(length == 0) { cout << "removeStart : List...
[3 replies] Last: is *p the pointer dereferenced? Yes! delete p destroys the pointed-... (by mbozzi)
Adding 2 linked lists
 
The program adds numbers within two linked lists. My programs does that but the remainder from each number added isn't going to the next number. How do I fix th...
[3 replies] Last: You have to process the pairs in certain order in order to carry the "... (by keskiverto)
Function only works once
 
The 'multiArrayCipher' function calls on 2 other functions to fill a vector and then output that vector. However, only the first vector gets filled and outputte...
[5 replies] Last: vector::reserve() reserves space (internally changes its 'capacity' va... (by icy1)
by Meso
end of file controlled while loop not working as required
 
Mike 85 83 77 91 76 CSC Mark 80 90 95 93 48 CSC Anderson 78 81 11 90 73 BUSS Blair 92 83 30 69 87 ECE Suzy 23 83 30 69 87 ARC Carlos 46 76...
[1 reply] : Hello Meso, Welcome to the forum. PLEASE ALWAYS USE CODE TAGS (the <... (by Handy Andy)
by koopey
how to purposely fail "fopen" for debuggin
 
I need to purposely fail the "fopen"-ing of a file to test my code. How do I do that. my code so far: void MeshTrian::init (std::string filename) { ...
[4 replies] Last: Change the permissions on the file so it can't be read by the program.... (by dhayden)
selection sort of char array
 
I have a code that reads in data from a file and outputs the frequency of each letter in the file. It counts the number of words in the file and the total numbe...
[2 replies] Last: Most of the initial post and logic is working; very nice! Rewrote for... (by icy1)
arrayOutput function and possibly arrayFill function not working
 
When I selected option 2 from the menu, it only displays "The new version is". It does not display the multiArray arrays. #include <iostream> #include <c...
[5 replies] Last: Hello Shezshade, I hope that the green check means that it is working... (by Handy Andy)
by beemo
Passing 2 & 3 dimension arrays by reference
 
Please can someone explain to me how to pass my arrays into the fuction an call it by reference im stuck :( #include <iostream> #include <fstream> #incl...
[3 replies] Last: [quote=keskiverto]Why do you want to call them by reference? @beemo, ... (by icy1)
Reading large integers into linked list
 
I have a large integer , 234321, stored in a text file, input.txt. I want to read it, digit by digit, then insert into a linked list. This doesn't work, I know ...
[6 replies] Last: I'd do a single read to seed the linked list with the first number, an... (by icy1)
Struct and nested structs
 
I'm having trouble how to figure out this problem I'm assigned. When I'm referencing the code I keep getting a message saying "no matching function for call to ...
[3 replies] Last: students means you want to access array element at index NUM_STUDEN... (by Peter87)
April 2018 Pages: 1... 910111213... 25
  Archived months: [mar2018] [may2018]

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