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...
[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...
[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();...
[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...
[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...
[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...
[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,...
[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...
[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...
[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...
[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...
[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...
[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...
[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
[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 ...
[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...
[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...
[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...
[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...
[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.