Beginners - June 2018 (Page 9)

expected ';' before int (help pls)
 
I am getting the error: error: expected ';' before 'int' This is my code that I am trying to run. I am very new to this. #include <iostream> #include <s...
[3 replies] Last: I forgot to put ';' after std. Its solved now :D (by PuruSingh)
Having trouble with business plan
 
I'm getting a C4244 and C4700 problems with Lines 30 and 31. I'm new at this and pulling my hair out. I could really use some help please. //Linda's new...
[2 replies] Last: #include <iostream> int main() { // Need to enter the the total ... (by JLBorges)
Deactivating system navigation
 
Hi, I have a published game on xbox but the B button backs out of the game to the home page. Im told I have to do something with the SystemNavigationManager but...
[no replies]
by TimmyT
Avoiding long member initializer lists
 
Hey guys, to get used to object-oriented programming I started to setup a little text-based RPG and I need a little help with the structure and hope you can ...
[4 replies] Last: Hi, If there are too many parameters required for a constructor, that... (by TheIdeasMan)
Help pls. how can I enter characters without enter ?
 
Help how to cin() && '\n' with std ? #include <iostream> using namespace std; int main() { while( true ) { if( cin.get() == 'w' ) ...
[1 reply] : You probably need a function such as getch() from NCurses: https://w... (by RUNNER PRO AGARIO)
Const redeclared in main() with new value?
 
What happens if you redeclare a variable that is already static and declared outside of main() kind of like: #include <iostream> using namespace std; const...
[1 reply] : This is known as "shadowing". In the scope where you have created anot... (by Repeater)
number of possible permutations in arranging elements
 
I have a sequence a with length N created by removing some elements (possibly zero) from a permutation of numbers (1,2,…,N). When an element is removed, the l...
[2 replies] Last: https://www.codechef.com/COOK95B/problems/GOODPERM (by closed account LA967k9E)
by rynone
Multidimensional Array Pointer
 
I need to create a dynamic array. I have read many forums and the best solution is to create a single dimensional array with pointers. However, the simplified...
[8 replies] Last: I've changed my code to follow tpb's example above and it gives me th... (by tpb)
Array of Pointers to Class
 
Can someone help with this question? I'm getting confused to check the null value A cowshed with 50 boxes as a class variable, each box can be occupied by one...
[3 replies] Last: I have one more question. I separated my Programm in cpp, hpp, and mai... (by kik1116)
File Handling : Getting One Extra Character!
 
So I was going through File handling again trying to make a big program to perform certain operations on a file but now i can't move forward because of this err...
[2 replies] Last: It is because your first implementation tested the stream state after ... (by jlb)
by Nirit
std::vector
 
trying to print a vector in a reverse order. receiving casting error on the last loop. don't understand why. #include<iostream> #include <vector> int main() ...
[1 reply] : // for (std::vector< int >::reverse_iterator rit=vec.rbegin();rit!=ve... (by JLBorges)
advice please
 
v
[1 reply] : You'd want to read in user input using a string instead of an integer ... (by Uk Marine)
by jplank
How to reference elements of a returned vector
 
I have a class that returns a vector. void test(vector<double> v){ return v } I don't understand how I access the individual elements of the v...
[1 reply] : Normally you pass a STL container by reference or const reference sinc... (by Thomas1965)
by Lehti
Linked list nodes: pros and cons of each approach to writing them
 
I'm currently in the middle of studying for my Programming 2 finals, which essentially is a practical test about data structures and sorting algorithms. We've ...
[2 replies] Last: > Does anyone know of any other approaches to writing nodes? This is ... (by JLBorges)
Search function only works for the first object
 
I am having a hard time with my search function. It only finds the first created object. Any ideas where my problem is? #include <cstdlib> #include <iost...
[2 replies] Last: ah yes, That fixed it thank you! (by keweisbrod)
by facade
Having a hard time calculating percentages.
 
Use a sentinel controlled while loop that will ask the user to enter student grades until a value of -1 is entered. Use a counter variable to count all the gra...
[1 reply] : percent is literally just a division by 100 of something. Generally ... (by jonnin)
by Donut
If Else If vs Switch
 
The code below works but I have to believe there is a better way. I am brand new to programming and could use some guidance on improving the code. I am using I...
[5 replies] Last: I worked on the code some today after reading through some tutorials a... (by Donut)
need help with some homework
 
my teacher has given me a assignment for c plus but im at my wits end here. im so frustrated! heres what he wants You are tasked with creating a mileage cacl...
[1 reply] : The keyword here is "calculate". You're not doing any calculations her... (by Lehti)
Pulling best/worst data from a file
 
everything in my code is working as it needs to, except the best and worst MPG. two issues are happening: 1: the best/worst MPG is not giving the correct # 2...
[4 replies] Last: Yeah just caught. thanks for your quick responses. Its all working no... (by justStarting)
by H00G0
Issue reading from file.
 
Hey! I'm writing a function for my game. This function reads data from a file and stores it into a structure, which then is stored to a vector. Here is my cod...
[5 replies] Last: My bad, I was trying to access slots .Rect whereas I defined it as ... (by H00G0)
June 2018 Pages: 1... 7891011... 19
  Archived months: [may2018] [jul2018]

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