Beginners - April 2021 (Page 2)

Test Question gone wrong
Hello, I am new here and have a question. I just took a c++ test and disagree with one of the true/false questions. The exact question is: The floor(x) function...
Apr 29, 2021 at 2:23am
[6 replies] Last: Thanks for the replies everyone, he hasn't responded to my e-mail yet.... (by farmsmaqs)
C/C++ hackerrank question
Hello, I am using hackerrank to get better at solving problems, but for some reason it is teaching C stuff in among the c++ stuff. I know C works with C++ and t...
Apr 29, 2021 at 1:30am
[3 replies] Last: This may help: https://www.cplusplus.com/reference/cstdio/scanf/?kw=sc... (by JRManx)
by NMI21
search function fstream
Hi guys, as you can see in the code section I wrote a program which searchs a word in a file and then gives out the line in which the word was found. The user i...
Apr 28, 2021 at 4:26pm
[5 replies] Last: So the program searches for a word in the text. all lines with the wo... (by seeplus)
by hitasa
Need a lil advice from more experienced ones
Hi, Im trying to write a program that reads from text file how many times each "patient" occurs in a text file. Example: P1 D1 M1 P1 D2 M1 P2 D3 M2 M3 ...
Apr 28, 2021 at 4:03pm
[5 replies] Last: Is this something like what you want: #include <string> #include <m... (by seeplus)
How would I identify the stack and heap in int main?
Wondering how I can identify memory within c++ program, code is here: https://pastebin.com/S2KMYcKV
Apr 28, 2021 at 3:49pm
[6 replies] Last: For MS VS, the small buffer is 15 bytes. #include <string> #include... (by seeplus)
Compiler cannot find iostream
As a complete beginner I have been trying to "get into" C programming. While following a tutorial the following code failed to compile. Compiler reported it did...
Apr 28, 2021 at 1:41pm
[6 replies] Last: Good day, I did post here again, but it seems to have disappeared. I... (by johnOk9)
Filtering Words using ifstream/ofstream
I'm a little confused with an assignment that i've been given. I am wanting to show the count of each individual word in the text1.txt file. The banned.txt f...
Apr 28, 2021 at 12:39pm
[14 replies] Last: As case insensitive: #include <string> #include <iostream> #include... (by seeplus)
complete the code plz
can anyone plz complete this code, its for ma exams, thank u #include <iostream> using namespace std; class midq1 { float x; float y; public: ...
Apr 28, 2021 at 9:11am
[2 replies] Last: Based upon expected output and incorrect given code, perhaps: #incl... (by seeplus)
Writing a Rock-Paper-Scissors game using different functions.
[C++] Hi! I'm very new at programming and I need your help with my homework. I've had a hard time correcting mistakes but whatever I changed, it just seems to g...
Apr 28, 2021 at 1:15am
[4 replies] Last: Thank you all for the tips! The code's working now by the way! (after ... (by gfriend owemji)
deleted
Do not cross-post. http://www.cplusplus.com/forum/general/277697/
Apr 27, 2021 at 9:22pm
[5 replies] Last: The OP removed the content of the original posts (making them pointles... (by closed account z05DSL3A)
by zavkk
Delete data from a file
Hello, im making an schedule and im saving the data in a .dat file. All the data are contacts wrote from an struct and i want to delete a contact from the file ...
Apr 27, 2021 at 7:23pm
[1 reply] : What kind of file is it? A text file? Very rigid binary file? In gene... (by Ganado)
by NMI21
Read out what somebody wrote in cmd! (1,2)
Hi, i want to code a program which i start over the cmd. For example if i type in the cmd "file.exe -b example hello" .Ialready added the debugging arguments....
Apr 27, 2021 at 5:20pm
[20 replies] Last: Disclaimer: I've never used <filesystem> You don't need to for this ... (by Ganado)
Count how many times a banned word has occured from a text file
I have been having issues trying to get a map, vector etc to work in order to print out how many times one of the banned words has occured in the text file. ...
Apr 27, 2021 at 4:37pm
[5 replies] Last: //Step 2 //Do a comparison between the words from "search1.txt" and ... (by lastchance)
by zavkk
Main function type
Why do we write int main instead of char main or bool main?
Apr 27, 2021 at 10:03am
[4 replies] Last: If the program is used within something like a batch/script file, then... (by seeplus)
How to fix the errors with my class functions
My class functions have been giving me errors and I am not sure how to fix it. I'm wondering how to get them to work properly with my main function so my code c...
Apr 27, 2021 at 9:17am
[17 replies] Last: Based upon previous code, perhaps something like this. Obviously there... (by seeplus)
Correct approach for non-blocking user input
Hi I have an application where I need an object to be updated by user input without blocking another function which reads that object at any given time. I thin...
Apr 27, 2021 at 3:02am
[1 reply] : when you reach cin >> num; line, the current thread execution will s... (by ne555)
Having issues with generic Insertion Sort implementation
Hello guys, i hope you are all good! If you have time for me, I'm implementing a generic library using Insertion Sort: #include <stdlib.h> #include <errno....
Apr 26, 2021 at 11:01pm
[10 replies] Last: I think the point is to make InsertionSort() generic so it will work... (by dhayden)
Stroustrup - Programming: Principles and Practice Using C++ - std_lib_facilities.h Works With IDE but Not gcc
I seem to be the perennial newbie here, but I have set myself the goal of working through this book. Using CodeLite, if I place the header file created by Strou...
Apr 26, 2021 at 9:52pm
[9 replies] Last: I'm not saying the header is bad , per se; I'm saying to use it with ... (by JRManx)
Little help understanding function
just wanted to a function to print my dice rolls. But for some reason, it dosen't print anything. #include <iostream> #include <cstdlib> #include <ctime> usin...
Apr 26, 2021 at 2:32pm
[2 replies] Last: Modified to use modern C++ for generating random numbers and container... (by deleted account xyzzy)
Trying additional moves in the Knight's Tour problem
Hey! I am teaching myself how to program from the Deitel 10th edition "How to Program" text, and I'm currently working on a brute force solution approach to the...
Apr 26, 2021 at 2:02pm
[7 replies] Last: move = (move + 1) % N; // keeps move in range [0, N - 1] I haven... (by doug4)
April 2021 Pages: 1234... 12
  Archived months: [mar2021] [may2021]

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