Beginners - July 2018 (Page 8)

Array and input files.
 
I never quite figured out how to use input a file so the program uses it (or really anything files) so I don't know what I am missing or what im doing wrong. Th...
[2 replies] Last: Both of your programs require exactly MAX numbers in the file. Otherwi... (by dhayden)
Write a function that takes an object as argument and deletes that object from an array of objects
 
So I have two classes, one for contactInfo and another for contactBook. I create a few contactInfo objects and add them to listofContacts array in contactBook ...
[2 replies] Last: One minor but important change to Thomas1965's suggestion: that operat... (by dhayden)
operator precedence #2
 
Hi guys, after a longer break, I continue with learning C++ and I arrived at the same problem I had in one of my last threads: http://www.cplusplus.com/foru...
[16 replies] Last: Then the book is wrong, hopefully not at more important places =( Tha... (by PhysicsIsFun)
Segment Fault.
 
So i`m trying to finish up a program i`ve been working on but I have hit a wall with a segment fault. It runs perfectly for a little bit but than as you go alon...
[2 replies] Last: Unfortunately it’s my professors backwards apostrophe it messes with... (by sgill1998)
Code Review - Printing Variable Information to Console
 
Hello, I was hoping a few people would take a quick look at some super simple code I created. The program simply prints the memory location, size, and value of ...
[1 reply] : Sorry, I didn't get round to sorting the arrays out similarly, but you... (by lastchance)
Finding the Sum of Digits Recursively
 
This recursive function is intended to sum a numbers digits, but it always returns the expected answer-the amount of digits. So for example, If i enter 567, it ...
[8 replies] Last: Thank you, and I wrote write after the initial post the other changes ... (by One Pea)
Find possible values of a,b,c,d (my answer is giving tle)
 
Write your question here. From an array of N(<=1000) we have to find all possible values of a,b,c,d such that a^2+b=c^2+d^2 We have to do it for T(<=5)Test ca...
[18 replies] Last: b is definitely the tricky part, and probably the clue to a better sol... (by tpb)
how to move front node to last node in linked list.
 
So I`m trying to move my front two nodes to the back of the list. I don`t understand what I am doing wrong here. #include<iostream> #include<string> struct ...
[1 reply] : Well, you inexplicably have a "link" and "next" which you seem to use ... (by tpb)
Crypting text (char array)
 
Hi, I must write a code that takes 4 lines and crypt them with a number. I have already looked on the forum since it's a classic homework problem, but I stil...
[5 replies] Last: Wait? Really? Was it always this way? One of the first rules of pr... (by Manga)
by zzzhhh
How does static member behave across multiple files?
 
I am testing static member variables on Windows using Visual Studio 2015. The project comprises three .cpp and one header: StaticHeader.h: #pragma once ...
[3 replies] Last: I think if you had classname<int> a and classname<double> b combined... (by jonnin)
by Matriz
Hot Plate
 
I honestly don't know what to do to make this output the information I want it to #include <iostream> #include <iomanip> #include <string> #include <fstr...
[3 replies] Last: Google "steady-state temperature distribution rectangular plate" or, p... (by lastchance)
by Nico
Memory increases because of deleting
 
Hello, I have made a queue that keeps all the values in the order in which they were originally placed (like a deque) but does not accept any duplicates (li...
[11 replies] Last: The libstdc++ (GNU) implementation of std::deque (the one being used... (by JLBorges)
by ysf007
How to get the smallest value group by string variable ?
 
Hi, I'm new at c++, I've an output as follows got by looping over a vector of an objects vector<lable>, int i = 0; vector<Label> myVect; for(auto & v: myV...
[5 replies] Last: @lastchance thank you (by ysf007)
const char to char
 
I cant seem to find where this conversion error is at #include <iostream> #include "birthday.h" #include "people.h" using namespace std; template <...
[1 reply] : Use single quotes for characters. Double quotes are for strings. bo... (by Peter87)
by zapshe
What does the "&" do in the scenario?
 
Hi, been a while since I posted here. Learning C++ has been getting easier. Anyway, there's a program which will use virtual functions in order to make sure th...
[7 replies] Last: Thanks for letting me know tpb. Also, thanks keskiverto for the clarif... (by zapshe)
NMNX 100pts for NSA/EQUILIBR 100pts (1,2)
 
1 0 AC (0.020000) 1 1 AC (0.010000) 1 2 AC (0.020000) Subtask Score: 20.00% Result - AC 2 3 AC (0.110000) 2 4 AC (0.440000) 2 5 AC (1.890000) 2 6 A...
[39 replies] Last: There is nothing wrong with private messages. There is something VER... (by closed account E0p9LyTq)
input validation
 
I have tried using while statements, if statements, do while statements etc. None are working. I want to be able to have the input be validated and if the input...
[3 replies] Last: Thank you for this. I am still a beginner even though I have already ... (by lkordich)
Binary Search and Console output stops
 
Hello, I have a problem and I am having trouble searching for the solution. I had a program to write that required me to sort an array of student Ids and the in...
[2 replies] Last: Works well now, I feel silly for such a minor mistake. Thank you again... (by KeaganM)
Can someone help me with File I/O
 
I have a file with 100+ lines. I want to check each line one by one. After I am done with Line 1 I move on the Line 2. Okay I think the real question is: How ...
[8 replies] Last: the istream ">>" operator splits on whitespace by default (space, tab,... (by icy1)
by Delgeo
Cannot verify selected GetLogicalDrive()
 
Hi everyone, i have spent quite a few hours trying to solve this puzzle.. for some reason i cannot test for a matching string i input via the console app i am...
[4 replies] Last: You've not made it easy for yourself with those variables. You really... (by kbw)
July 2018 Pages: 1... 678910... 17
  Archived months: [jun2018] [aug2018]

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