Beginners - February 2022

by hevi
No clue
 
Hi, got a problem with my code. Keeps saying error : cant convert string to int. But Im not trying t...
[7 replies] Last: It's because in the info function you put int first, string second and... (by mikef)
using const with function
 
what is the purpose of using const with function void readData () {} void readData const ...
[3 replies] Last: It is a promise that the function will not modify the object that it's... (by Peter87)
Stuck trying to #include interdepenant headers
 
I have two classes and in each class I would like to have a pointer to an instance of the other. B...
[4 replies] Last: >You must forward declare ClassB. and you must forward declare ClassA ... (by ne555)
Error code not in scope
 
I have been working this program for a while for my class so far it will not compile. The instructor...
[4 replies] Last: Simply without input validation consider: #include <iostream> using... (by seeplus)
by AkiraC
How to perform insertion sort for array with more than one variable?
 
Hi, I have an array with more than one variable, eg: ID, name, gender etc. And I want to perform sor...
[2 replies] Last: There's something oddly familiar about that code.... Mmm, interesting... (by salem c)
Printing out name of station that matches max and min temp in a file
 
Hello, I have a file that has a bunch of information in it about weather data. I currently need to f...
[6 replies] Last: Another way of getting rid of the preceding whitespace is: while (st... (by againtry)
sample without replacement - efficient way
 
Greetings! I have an array of which I would like to draw n samples without replacement. The quality ...
[12 replies] Last: [quote=mbozzi]Could you be thinking of Fisher-Yates? I was! But I had... (by lastchance)
by hevi
Decompressing RLE
 
Hi, I have an RLE compresser which works perfectly fine, but how do I decompress it? I have no idea ...
[15 replies] Last: hevi, STOP reporting posts you don't like. That makes people consider... (by deleted account xyzzy)
Size of Char in C
 
Hello, I ran the following code in Visual C++ and I have 1 and 4 In GCC 11.2 I have 1 and 1 W...
[6 replies] Last: sizeof(char) is always 1. (by Peter87)
Keep getting 4 errors in my code and dont understand
 
hey. in my code im keep getting errors and i don't understand what they mean and how I can correct i...
[4 replies] Last: If you have something like a vector, then you can sum the contents eas... (by seeplus)
C++ program to read integers until 0 is entered using sentinel.
 
Hello, I'm trying to write a C++ program to read integers until 0 is entered using sentinel. (1) Di...
[8 replies] Last: [See also http://www.cplusplus.com/forum/beginner/282399/ ] (by seeplus)
I need help with this assignment
 
I need to write a code that loads 5 numbers from a user and sums up the ones that have only 2 digits...
[3 replies] Last: #include <iostream> constexpr int NoNums {5}; int main() { int re... (by seeplus)
C++ program to read integers until 0 is entered using sentinel.
 
Hello, I'm trying to write a C++ program to read integers until 0 is entered using sentinel. I want ...
[1 reply] : [Duplicate post] (by seeplus)
I can't figure out this assignment.
 
Hello, I'm trying to write a C++ program to read integers until 0 is entered using sentinel. I want ...
[5 replies] Last: [See http://www.cplusplus.com/forum/beginner/282399/ ] (by seeplus)
I can't figure out this assignment.
 
How would I go about making a different message appear when no positive integers or negative integer...
[3 replies] Last: Perhaps: #include <iostream> #include <limits> constexpr int MinIn... (by seeplus)
how to get a file line to do more than just print? (1,2)
 
hello, how can you get a text file with data like this do more than just print out a line. Fred...
[21 replies] Last: I liked my highschool's system best of all. 10 points per grade, so 9... (by jonnin)
operator overloading
 
In my book the below code for the operator + is written in a way that makes a new temporary Date and...
[6 replies] Last: If you want to something custom & weird, I recommend using things like... (by jonnin)
by lare26
Disfunctional Function Declaration (1,2)
 
I am trying to figure out why this doesn't work. I thought I was doing it correctly. But the scope s...
[32 replies] Last: [Moved making a game chatter here]: http://www.cplusplus.com/forum/lou... (by deleted account xyzzy)
by vboro
do{...}while(...) loop to chech array?
 
Hi! I have an array with numbers from the user. My task is to then std::cin numbers and check if ...
[5 replies] Last: seeplus's first sugestion worked perfectly fine, just what I wanted my... (by vboro)
Constructor syntax
 
Someone could explain me the following declaration for the contructor? class GameError : publi...
[3 replies] Last: As you browse those those linked pages, you should also notice that ... (by keskiverto)
February 2022 Pages: 123... 7
  Archived months: [jan2022] [mar2022]

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