Beginners - December 2020 (Page 3)

"message only" window not receiving messages....
 
Im just annoyed with this, its really just a means to an end that i need to recieve messages and for whatever reason. Im just running out of rocks to turn over...
[3 replies] Last: ok so now I can at least verify that the registration did in fact work... (by markyrocks)
by dasdas
problem with while loop
 
I have a program that make an array of the input number's receding number, then multiply them using the while loop. But why is it that the output always 0? Is...
[5 replies] Last: Now that you've used code tags commenting on your source code is easie... (by George P)
C++ allowing the program to accept repetitive inputs
 
Hi. I am a beginner in programming. I am trying to make a program in which the heights of N people will be input in centimeters. How do I write a short code tha...
[3 replies] Last: double height; while(std::cin >> height){ //... } (by ne555)
by kmce
declaring streams in header and cpp file
 
I am trying to declare a 2 streams, 1 for input and one for output, I know how to do this normally, but I am trying to do it now in a class, and over a header a...
[4 replies] Last: to clarify: using the {} locks you to the one file name. Is the name a... (by jonnin)
classes
 
That's my third lesson of classes and I am having trouble with my HW, I've to create an object with 2 properties and the object has to return addition, subtra...
[6 replies] Last: Thank you very much indeed, Great help from great people! (by MaxGreen)
by yvez
std::tolower ignores return value, is there a way to fix this?
 
Hello, I just made a function that will turn your string into a lowercase letter but every time I run it doesn't work. The compiler says "tolower ignored return...
[5 replies] Last: > for (char& c : word) > c = (char)std::tolower(c); This may engen... (by JLBorges)
*this pointer question
 
Hello, I am trying to get better understanding programming, so i found someone elses code online, so i could read it through and try and understand it, however ...
[2 replies] Last: Non-static member function has implicitly generated pointer to object.... (by keskiverto)
by dfchu
How to use copy_n and istream_iterator to copy integers from binary file to vector?
 
Hello, I'm trying to read from a binary file of unsigned integers and copy them into a vector using the copy_n function. However, when it gets to the copy_n co...
[10 replies] Last: #include <iostream> #include <fstream> #include <iterator> #include <... (by lastchance)
Compiling code to executable file
 
Hi all, Just starting out with C++ again after a long break since Uni. I have some experience in other languages but am still a very much a beginner with C+...
[2 replies] Last: Hi Ganado, Thanks that did the trick!! For those reading this thread... (by acsmith1986)
function with try and catch infinite loop
 
I am trying to call a function which has a try catch block inside, but it enters in some kind of infinite loop.If cin.fail() I want to catch the error and then ...
[6 replies] Last: @Ganado, thank you too! (by tiberiu1998)
Array and functions
 
Hello Guys. I did something but it's not correct. Can you adjust? Here is my question : Create array with 10 books(title, author, price, year of publication). C...
[1 reply] : what does it not do correctly? the min price may not print enough info... (by jonnin)
Clang Error linker command failed with exit code 1
 
Hi and Merry Christmas to you all This is my veri first C++ program that I wrote, and I get an error while trying to compiling (according to lecturer we have t...
[6 replies] Last: Thanks Handy for your great solution <3 (by habiballahafg)
What type of tree
 
hey, i gotta write a program that reads from a file the length of the necklaces. they are made with beads that are almost the same and i gotta make the two neck...
[5 replies] Last: Mechanically, a tree is just like a linked list with 2 pointers instea... (by jonnin)
new exercise
 
hi every one . im begginer in c++ programing. our master ask a question about printing a double diamond next to each other. if we write 2 in cmd : * ...
[7 replies] Last: For a tree, consider: #include <iomanip> #include <iostream> void ... (by seeplus)
Endless While Loop using classes
 
I've created a code which takes in 2 fractions, and performs various operations on it, e.g. add, subtract, multiply, divide. It then will simplify the fraction...
[9 replies] Last: You need to consider reviewing your code as the solution can be greatl... (by againtry)
by a1kh
the "recurrent_directory_iterator" inside std::filesystem Doesn't support files with "Unicode Characters"
 
I do believe that the problem is with the way "std::recursive_directory_iterator" handles the files. I tried to only print the files paths from the iterator wit...
[18 replies] Last: jlb (4855): Thank you.I hope that i could find a solution for this pro... (by a1kh)
convert int to double
 
hi. could you please help me convert int to double in the following code? #include <vector> using namespace std; struct Tree { int data; ...
[6 replies] Last: > hi. could you please help me convert int to double in the following ... (by salem c)
Problem with iterator arithmetic
 
I am having a problem with iterators for a forward_list. I am trying to erase a portion of a forward_list using erase_after which takes iterators as its argumen...
[3 replies] Last: Tbh, I've never used forward_list and hence splice_after. A split felt... (by keskiverto)
Which Data Type?
 
I am writing a calculator code but I need a primary data type that can store integer numbers and also decimal numbers at the same time. Is there such a thing in...
[8 replies] Last: Hello Fresh Coder, Have a look at this: https://en.cppreference.com/w... (by Handy Andy)
Extracting one type of data from a file
 
Hello! I'm studying C++ and am currently learning how to get information to and from files with my program. I've learned how to do it with one type of data at a...
[9 replies] Last: "My Name\n" "10\n" "\n" "Your Name\n" "35\n" ); getline( f... (by seeplus)
December 2020 Pages: 12345... 11
  Archived months: [nov2020] [jan2021]

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