Beginners - October 2018 (Page 7)

reading a line from a file and creating a vector of words from it
 
hello all, i am trying to create a function that reads a line from a file, creates a vector of strings with each word from that line in a different index, pr...
[7 replies] Last: thank you very much for explaining. i'll approach this right after i g... (by cppnoobie)
type of streams
 
I'm at time examining streams. I wonder of what type streams are. Essentially I thought if I intstantiate a stream, e.g. with std::ifstream ifs(my_file.txt); ...
[2 replies] Last: Thank you Peter, this operator was new for me. But it's sparse documen... (by nuderobmonkey)
how do i make this program loop?
 
Sorry for the long code, im trying to make this program loop up to the top after the user enters that they would like to continue, but I can't figure it out. Ar...
[3 replies] Last: One more thing. Please, use code tags <> when posting code. See http:/... (by keskiverto)
fstream library
 
I have a homework assignment where I have to convert a list of words into a list of phone numbers (ex. turning GET LOAN into 438-5626) from an input file into a...
[12 replies] Last: std::map<char,int> or, maybe std::map<char,char>. How do you get 1 or... (by lastchance)
by jujull
How to update the integer in other function
 
Every time I try to run this code, all the output become 0. Can anyone help me out? So, here's my code: #include <iostream> using namespace std; void...
[4 replies] Last: This assignment was before we learn array, so we shouldn't using any a... (by jujull)
Min max mid
 
In class, we had to do a loop, and cout some of its stats; the count, mean, min, and max. Using what I learned in class, I tried to see if I could figure out h...
[1 reply] : You cannot rely on if (num > mid) { ... (by Satan)
Conditional statement not registering AND condition.
 
Write your question here. So I am working on a short Survival based game as part of a project and I am practically finished, but this line of code is registeri...
[1 reply] : It's sosMade == true not sosMade = true = is for assignment an... (by Satan)
by rek49
patterns with while loop, even odd number
 
Hi I had one week trying to solve this program. I need to draw a box if the number is even and a triangle for odd numbers for example * * * * ...
[1 reply] : Question: Why are you asking the user to input a character? You only ... (by Satan)
by beemo
Returning Recursive function
 
pls, i just need help making this a returning function instead of void -> int and retunr the squared. void squared(int sq) { if(sq != 1) squared(sq ...
[1 reply] : return sq*sq would return you the square of the number. What are you... (by Satan)
If statements not executing when calling function
 
I don't understand why my if statements are not executing when calling "displayErrors" function. the output should be "Please complete:\n name\n phone\n address...
[2 replies] Last: Oh youre totally right, I didn't even notice that. thanks man! (by naguilar661)
parsing commands from an external file as commands to a datastructure
 
Hello everyone, This thread is an addition to the previous ones, because i've altered the functions i was asking about, and my question is regarding impleme...
[9 replies] Last: http://www.cplusplus.com/reference/string/string/c_str/ (by keskiverto)
"No matching function for call to 'book::book()'"
 
Hello. I am currently building a library in C++ but when I try to compile this, it states there is no matching function for the book constructor. Please help! ...
[1 reply] : You created a Book constructor with multiple arguments so the compiler... (by jlb)
writing class and using header and files correctly
 
Hello, in my pursuit to be a great c++ programming :) i am learning now classes, files, files such as cpp and header files, i read online to help me, and ...
[6 replies] Last: Gotya thanks, i will definitely remember that to keep the with the Log... (by siten0308)
by kretze
problem with binary trees
 
Write your question here. hy guya i have a problem with binary trees(im total beginer in binary trees today is first time when i do something with that stuff) ...
[19 replies] Last: Yes, except, as I wrote before, < should be > (in the insert() me... (by dhayden)
Help with Case/Switch
 
So this was an assignment I had to do for my Intro to Comp Science I, and the main objective was to write the functions that are seperated by each comment sayin...
[4 replies] Last: Ok, thank you. So each case needs to have a break added to it basica... (by jonnin)
Help with homework
 
The question for the program is Write a program that uses a loop to ask the user to input a total of 5 test scores between 0 and 100 inclusive. Test each in...
[7 replies] Last: This code worked to input and find the average properly within the p... (by jlb)
Online judge question
 
qed
[3 replies] Last: There is no simple way to solve these problems without proper understa... (by Thomas1965)
I need some help with hangman.
 
I need to be able to find the location of ALL instances of a single character in a string. This is my code so far: #include <iostream> #include <cstdli...
[4 replies] Last: @RandomCppN00b, I don't think that @JLBorges was expecting you to cut... (by lastchance)
by AL88
How can I make this print the arguments in reverse order
 
How can I make this print the arguments in reverse order? I tried re-arranging the loop and I can't do it. Thanks #include <iostream> int main(int argc...
[19 replies] Last: You're welcome. Hope it's all clear now. (by MikeyBoy)
Debugging My Homework and I'm stumped
 
main executes up until you make a menu selection (line 54), then seems to get stuck in an infinite loop. I'm not sure if the issue is in my switch statement (57...
[4 replies] Last: There's no such thing as "closing a thread". The thread will remain o... (by MikeyBoy)
October 2018 Pages: 1... 56789... 28
  Archived months: [sep2018] [nov2018]

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