Beginners - July 2017 (Page 12)

by stas76
Double linked lists
Hello, I am reading "Programming Principles and practice Using C++" by Stroustrup. Now I'm on chapter 17.9.3(pointer and Linked list). I understand how to use p...
Jul 3, 2017 at 6:21pm
[2 replies] Last: Thanks Enoizat I have realized this (by stas76)
counting letters in a string.
I am trying to traverse a string. This Program basically counts the amount of letters in a string and returns a number. I can't figure out this program. All I g...
Jul 3, 2017 at 5:52pm
[5 replies] Last: My two pennyworth: #include <iostream> using namespace std; char ch... (by Enoizat)
by ebii
ostream in template class
any idea whats the problem with the ostream ? #pragma once #include<iostream> using namespace std; template<class T> class p { T x; T y; public: p();...
Jul 3, 2017 at 2:43pm
[5 replies] Last: Yet another possibility is the unbound friend function template to the... (by gunnerfunner)
.unget
can someone explain to me what is.unget() mean /* Practice Coding Exercises Using command line arguments read in the file called Horoscope.txt */ #i...
Jul 3, 2017 at 10:56am
[11 replies] Last: if unget puts the char back into the stream again for read, would not... (by coder777)
Help Please! Binary 2 Decimal conversion using recursion.
I need to write a code that validates a user's entry as only 1's and 0's, and converts it into a decimal value. I am required to use recursion to do this. I am...
Jul 3, 2017 at 8:53am
[4 replies] Last: Use a string to represent the binary - the numbers of 0's and 1's gets... (by lastchance)
by Meden
Reading a stringstream 10 numbers at a time
If I have a very long sequence of numbers, how might I read them 10 at a time? #include <iostream> #include <sstream> #include <string> int main(){ std::st...
Jul 3, 2017 at 6:39am
[7 replies] Last: Thanks. :) (by Meden)
"List iterator not dereferencable"
Hi guys, I'm trying to make a program that reads a file, containing the first and last name of a set of candidates, then stores that information in a STL list,...
Jul 3, 2017 at 6:32am
[12 replies] Last: Obviously they won't work together. Ah, I didn't notice the confli... (by mbozzi)
[Problem] Extracting lines of text from file (1,2)
Hello Community, I really need help with the following problem, that, try as i might, can't get solved ... My current program is supposed to find and display...
Jul 3, 2017 at 2:40am
[35 replies] Last: I did, and it works without any errors warnings now. :-) And, since ... (by Misenna)
beginner thread question
I've just started learning threads yesterday. Based on code (below), I was expecting to see the output of both the main thread, i.e. 1 to 10 and the t1 threa...
Jul 3, 2017 at 1:56am
[7 replies] Last: In what circumstances would you use std::condition_variable instead o... (by gunnerfunner)
Sorted and Unsorted Letters
I've tried to get as close as possible to the knowledge that I have, and I just can't seem to do good on this project. If someone can help me or guide me on the...
Jul 2, 2017 at 7:06pm
[8 replies] Last: @JLBorges Wow, you saved my life. Thank you so much! (by Semirxbih)
Code will not open my file.
This statement will not open the file, therefore none of my code will work. What have I done wrong here? I'm starting to go cross-eyed looking at it and I'm s...
Jul 2, 2017 at 6:26pm
[1 reply] : Call perror and see if and what error msg you get. http://www.cplusplu... (by Thomas1965)
Declaring a 2d Array (1,2)
Can someone please tell me why it's telling me "a nonstatic member reference must be relative to a specific object"? I realize I'm not done here, but it's hard...
Jul 2, 2017 at 5:27pm
[22 replies] Last: I like a challenge and this is very interesting to me, but I don't se... (by jlb)
Help Please!! input not triggering the correct if statement
I am writing a program that converts binary to decimal and vice versa. When the user enters a character choice (D, B, or Q to quit) that actions is performed. W...
Jul 2, 2017 at 4:47pm
[5 replies] Last: cout << "Dec2Bin or Bin2Dec or Quit? (D/B/Q): "; cin >> choice; ... (by imprudentspace)
by sharbu
count of longest consecutive elements in an array
Eg. I U Z X K K K K K H H H Q H H H H H H H output: 7
Jul 1, 2017 at 9:29pm
[2 replies] Last: was there a question? this is a single straightforward for loop. (by jonnin)
by Meden
c/c++ runtime libraries from a developer point of view
If I am trying to make a program that will run on any Windows machine, what precautions do I need to take? I recently tried to run a simple program on another ...
Jul 1, 2017 at 8:56pm
[6 replies] Last: What do you mean by this? X86 ? To create a release version Win32 e... (by Meden)
Converting numbers into Digits & then SUm
We are only 5 chapters into our textbook & I need to ask a user to input a number and then output it as digits. QuESTION = (1) How do you convert an inte...
Jul 1, 2017 at 7:15pm
[14 replies] Last: I definitely misunderstood the question. Sorry, ninjanewbie. (by Enoizat)
how to iterate through a vector within a map
I would like to iterate through a vector within a map, but for some reason I am getting no operator matches these operands "<<" on line 17. # include <i...
Jul 1, 2017 at 6:54pm
[8 replies] Last: Assuming that is the only warning or error the next step would be to f... (by jlb)
Classes
There's something I don't understand about classes. I mean, when I declare a class type which contains a member whose value rely on other members within the cla...
Jul 1, 2017 at 2:00pm
[5 replies] Last: Here is all the code combined and a main that demonstrates some of the... (by dhayden)
by Moobs
Why are my or operators not working?
Hey guys i am very new to c++and started doing some of the beginner projects found on this forum. in the following code. can someone explain to me why i can n...
Jul 1, 2017 at 12:10pm
[14 replies] Last: code from code777 im sorry to say did not work It actually does work.... (by coder777)
July 2017 Pages: 1... 101112
  Archived months: [jun2017] [aug2017]

This is an archived page. To post a new message, go to the current page.
Registered users can post in this forum.