Beginners - June 2020 (Page 5)

by rock33
Best Read File Code?
hello community, I need to read the elements from file.txt: number, string what is the most performing way, even if there are thousands of lines? I curr...
Jun 17, 2020 at 6:13pm
[6 replies] Last: i change my read file function with only one while() bool hashtable... (by rock33)
Program to check whether a field is private
Is it possible to check in a program whether a given variable in a class in some other program is private or not by, for instance, using try and catch ?...
Jun 17, 2020 at 2:53pm
[7 replies] Last: Compilers are not the only programs that read source code. There is, ... (by keskiverto)
#include Statement not finding a correct path
Even though I copied the complete path and pasted it in the #include statement, building the file fails with: fatal error C1083: Cannot open include file: 'open...
Jun 17, 2020 at 2:41pm
[4 replies] Last: Thanks! Workin on it! (by Bohicaman1)
by Mif
How to set custom cursor overall in my SDI ?
Hi .. any help how to set my custom cursor over the entire project ? I have lots of static controls buttons and widows... and i just want to use overall the sam...
Jun 17, 2020 at 2:26pm
[1 reply] : In WM_SETCURSOR you can use SetCursor(...). See: https://docs.microso... (by coder777)
by rock33
Why this list print only one element?
Hi Community, i make a disjointset and when i make union, i push back in an list for after print all elements, qhy no print all element, but only last insert? ...
Jun 17, 2020 at 2:24pm
[10 replies] Last: I solved, we were missing endl; at the end of the cout (by rock33)
Error not all control paths return a value
Hye! I am trying to visualize 3 data structures. It's giving an error C4715 "Bst search, not all control paths return a value" . int Search(int v, ...
Jun 17, 2020 at 1:50pm
[2 replies] Last: Hello lost110, It has been my experience that the C4715 has been a wa... (by Handy Andy)
Hey please answer this question
To model the volume of a room, develop a structure called Volume, which uses three variables of the Distance type. Assign a size to a variable of type Volume a...
Jun 17, 2020 at 1:50pm
[2 replies] Last: cout "enter width/height/length and stuff" cin >> x >> y >> z; v = x*y... (by jonnin)
Infinite Loop Bug
When I enter a character or other symbol into this section of my code, it infinitely loops. When I put a number value into it, the error and re-input loop wo...
Jun 17, 2020 at 1:03pm
[3 replies] Last: If you try to extract a number from cin and the next character isn't a... (by dhayden)
std::thread vs std::jthread
Can someone involved with the committee please explain to me in plain English why we have two classes and not one with both behaviors (start/cancel/stop vs not)...
Jun 17, 2020 at 12:19pm
[1 reply] : Repost bot - https://www.reddit.com/r/cpp/comments/h9lkam/stdthread_vs... (by salem c)
explanation
guys can someone explain to me whats this and what does it do ? int x=10; int *pointer = &x; cout << &*&*pPointer << endl; <=== ??????...
Jun 17, 2020 at 3:17am
[2 replies] Last: ty for helping ; ) (by John3682)
by GonlyG
inputting into double array with set size is looping forever
I have a line that says how big two arrays should be and to input x1 and y1 coordinates but it keeps looping forever... //connect dots to make triangles ...
Jun 16, 2020 at 5:07pm
[1 reply] : int triangles; double x ; double y ; cin>>triangles; ... (by salem c)
C++ DATA STRUCTURES
HOW DO I PERFORM AN ASYMPTOTIC COMPLEXITY ANALYSIS FOR THIS ALGORITHM . #include <iostream> int main() { std::cout << "Enter 10 numbers: "; ...
Jun 16, 2020 at 4:53pm
[2 replies] Last: one loop O(n) I think you meant. But these kind of generalizations a... (by jonnin)
Receiving a return of what looks like an address when trying to sort an array of a structure
I have created a program that reads a text file and stores into an array of a structure. For now I only have it set up to read entering a choice of 2 so as to t...
Jun 16, 2020 at 4:24pm
[13 replies] Last: If you test success of only the first field of a record, then you don'... (by keskiverto)
Unable to open file include: 'android / api-level.h': in Visual Studio Code 2017
Please help me I tried to compile this source code in C ISO Std using in the include header <sys/stat.h> : #include <stdio.h> #include <unistd.h> #inc...
Jun 16, 2020 at 11:32am
[1 reply] : Hello donovan68, I am not sure about your installation of VS, but my ... (by Handy Andy)
Comparison and Swaps Counter for Quicksort only Outputting 0 no matter the data size or list sorting
Im currently trying to implement a c++ program which compares the number of swaps and comparisons in a variety of different sorting methods. The program appears...
Jun 16, 2020 at 8:11am
[2 replies] Last: Indeed. In the example: first = a last = a + 8 (first - last) = a - (a... (by keskiverto)
While loop won't end
I've tried 3 different ways to end the loop and none have worked. It just scrolls. #include <iostream> using namespace std; bool compute(int base, in...
Jun 16, 2020 at 2:49am
[6 replies] Last: Thank you so much (by Programmingaddict)
Generate Random Objects of Varying Classes
Hi, I'm just getting my feet wet by trying to make my own console game. The goal is to play as a fighter and kill monsters to level up. The issue I'm having ...
Jun 16, 2020 at 2:47am
[7 replies] Last: @MikeyBoy I wish I had understood that a few days ago. After a lot of ... (by devious dm)
Matrix in Code -> .txt file
I need to move g_tileState and g_shipPlacement into text files saveGameTileState.txt and saveGameShips.txt respectively. If you code wizards can debug the code ...
Jun 16, 2020 at 2:39am
[3 replies] Last: You can just use stream extractors, like how std::cout and std::cin fu... (by poteto)
by momof4
trying to draw a circle with a number in it
For an assignment that I had to do a few months ago, they provided a circle with a number drawn in it for us to use. Now I'm trying to reuse that code for a per...
Jun 16, 2020 at 12:11am
[7 replies] Last: Thanks guys, got it figured out! :) (by momof4)
Can't figure out why this program works with a pointer array but not a normal array with large data.
I was trying to solve a problem on hackerrank and I finally got it after a couple of hints from the discussion but I am not sure about a couple of things and wh...
Jun 15, 2020 at 11:04pm
[3 replies] Last: I'm not sure what you mean by "the second snippet shouldn't even com... (by jlb)
June 2020 Pages: 1... 34567... 12
  Archived months: [may2020] [jul2020]

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