Beginners - September 2019 (Page 6)

Reading a file in C++
 
My engineering computations teacher gave us an assignment that requires the program to read the text...
[4 replies] Last: Okay, so why don't you give it a try? In the code you posted I see no ... (by jlb)
Count and Display a value>0 but <1
 
Question is in the title for(int index = 0; index < a.capacity( ); index++) if(a > 0)...
[4 replies] Last: Ok I see what I was doing wrong. Atoi converts string to int not doubl... (by sadCoder)
Amount of words in file
 
I want to find amount of words in my text file. But if on the end of the line is my program stop w...
[1 reply] : If I may, I would just say scrap what you have and just use cin's >> o... (by Ganado)
I just started writing code.
 
Write your question here. I just started writing code. Not sure where to expect help from everyone....
[2 replies] Last: Hello dotkickpra, There are many different styles for writing code an... (by Handy Andy)
by colt
Initializer list with inheritance
 
Hello. I wish to create a constructor that simultaneously uses a initialization list and calls the c...
[7 replies] Last: @lastchance: search for projective space this allows you to represent ... (by ne555)
Error in If else statement
 
Hi everyone, I new to C++ and seeking for some advice from c++ experts here for the following task. ...
[8 replies] Last: Hi mbozzi , furry guy and lastchance , I had fix my code ... (by sarah1993)
file parsing
 
I have the following file in the format. Date : Wed Jul 26 14:52:51 2017 ********************...
[1 reply] : http://www.cplusplus.com/doc/tutorial/files/ http://www.cplusplus.com/... (by lastchance)
by cash
loop not exiting
 
For some reason when I enter -1, my loop is not exiting. #include <iostream> using namespac...
[3 replies] Last: ... (by Duthomhas)
vector size changes in and out of function
 
I created a vector "entities" inside the object "_main" to hold members of a struct "Entity" that we...
[2 replies] Last: Oh, duh, lol, thank you you're a life saver. Still getting used to the... (by ForestLapointe)
putting together iterator, std_max and lambda expression
 
Hello I'm trying to find the biggest area size (width * height) of a list of objects inside a vecto...
[3 replies] Last: oh, I see. I tought std::max could return a reference to an element, a... (by Stauricus)
File IO and Struct
 
I'm currently writing a program that consists of displaying students' ID, Name, Course, Credit, and ...
[2 replies] Last: That seemed to fix my gradepoints error and the structure of the outpu... (by Orion98)
How can I add iteration to my code?
 
I have a text file like this: {4 <1,-1,-1> <1,1,-1> <-1,1,-1> <-1,-1,-1>} {4 <1,3,-1> <1,1,-1> <1...
[2 replies] Last: dear "salem c" so many thanks for your answer. (by leelion)
printing pow
 
At line '25', I have the following error which I'm not sure how to resolve. The error is commented. ...
[3 replies] Last: > A =pow((P *(1+r/n)) (n*t)); Pow takes two parameters, you forgot a c... (by salem c)
Change the value of a const variable.
 
Hello! Despite of the "const" in the variable declaration, why can't I change the value of "x" if di...
[2 replies] Last: A program that modifies the value of an object declared const has un... (by mbozzi)
Cout and char
 
Im trying to print a single letter grade in this program. But I keep running into issues with cout n...
[3 replies] Last: Thanks alot to both Andy and Highwayman. You're answers are the type o... (by Arcad31a)
Delete an element in an array list
 
I am attempting to delete an element in an array version of a list. When I use the function, it dele...
[12 replies] Last: I figured it out. The for loop was a better option. Thanks for the hel... (by closed account jEb91hU5)
Question on time complexity!
 
int a = 0; for (i = 0; i < N; i++) // Here the order is N { for (j = N; j > i; j--)// Her...
[6 replies] Last: This equation is for sum of series numbers from 0->N. Sure it is. So... (by jonnin)
How can i approach this problem. (1,2,3)
 
write an algorithm to extract all nouns from random text. The biggest problem with this is there...
[47 replies] Last: Well, another rage quit. I did not expect that... On the original top... (by Duthomhas)
Code::blocks 17.12 does not on C++
 
Hello, I installed code::blocks 17.20 from codeblocks.org, exactly 17.20 mingw.setup.exe, and it wo...
[5 replies] Last: If it is by Malik, then it is bad anyway. /opinion If you have good a... (by Duthomhas)
File isn’t changed.
 
I have a class called 'SaveStream' that takes data and saves it with a name next to it as a label, b...
[10 replies] Last: Hello highwayman, I started testing your revised program today. Ended... (by Handy Andy)
September 2019 Pages: 1... 45678... 13
  Archived months: [aug2019] [oct2019]

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