General C++ Programming - August 2019 (Page 4)

C++
 
Hello this is my project. Because I do not know how to define which file is marked sort or unsort when input file.(I already have 2 file sort and unsort of 2 d ...
[4 replies] Last: C++ is a general purpose programming language and widely used now a da... (by simpliv)
Need help please.
 
OVERVIEW Object bankAccount properties: balance, acctNumber, userName Object startMenu Object accountMenu Main Start Menu 1 Create Account 2 Acces...
[4 replies] Last: Start with a thing. string userName; cin >> userName; Then severa... (by salem c)
Numerology prog help - beginner
 
Hey I did some c++ back in high school and I just started getting back into coding as a cure for boredom. I saw a tombstone at a local graveyard and realized th...
[3 replies] Last: I made a little program to "add up" the dates by summing the digits in... (by dutch)
infinite loop not infinite
 
The following loop works as expected: infinite looping: bool loop = true; while (loop) { std::cout << "Infinite Loop" << std::endl; } the following ...
[2 replies] Last: Lol simple mistake. Brain farts happen to all of us, OP. (by TheToaster)
by Odglog
How to apply a delay to a specific part of the code?
 
Hello! My question is pretty simple, I am currently making a text-based top-down RPG game. Anyway, in the last game I made with my game engine I used a number o...
[7 replies] Last: Ok, it's working now. Thanks! :D (by Odglog)
Getting an error while reversing vowels in a string
 
I'm writing a code to reverse vowels in a string. I first took all the vowels of a string into a vector and then I looped the string from backwards by replacing...
[2 replies] Last: @philip92, @Repeater has the source of the crash. Now, consider what ... (by Niccolo)
Built In lower_bound function
 
When using the lower_bound function, why does subtracting the array give you the index value? int ind=upper_bound(final, final+n, temp)-final+1; ...
[3 replies] Last: Subtracting one pointer from another, gives you the "distance" between... (by MikeyBoy)
Array Struct Not Being Sorted
 
When I sort the second time based on compnow, the struct is not being sorted (line 67). #include <fstream> #include <iostream> #include <algorithm> using name...
[10 replies] Last: Update: I have solved the issue, it seems all I had to do was change t... (by aceadams)
Adjaceny matrix for dijkstra shortest path algorithm
 
Hi guys, I want to apply dijkstra shortest path algorithm to the following 2 files: projet14_milestone.txt projet14_process.txt projet14_milestone.txt look...
[3 replies] Last: I don't see any particular wrong in your code, and it does work in my ... (by ne555)
2D array
 
Hi guys, In the following code, the variable adjmatrix doesn't take the value I want it to take. 'Procedure' is the name of a struc t and procedure .process_no...
[5 replies] Last: > So 'start' should fit in char milestone_nom , isn't it? as ganado s... (by ne555)
'Function definition is not allowed here'
 
Hi guys, I'm trying to run the following code, but it seems there has to be a mistake in the main() part of the program. Every time I build the program, I recei...
[2 replies] Last: It helps if you use code tags -> http://www.cplusplus.com/articles/jEy... (by salem c)
Create file to access in program
 
In the program I've written, I stream data into a vector<struct> from some files up to sizes of 3GB. Each time I run the program it has to read the file and str...
[12 replies] Last: @JLBorges has a good take on this above. One thing I'd suggest, when ... (by Niccolo)
by zolo
out-of-line declaration of - template inline functions
 
Hi, I am getting the 'out-of-line declaration of' compiler error when trying to complie some libraries. I am wondering what causes this. The error appers whe...
[2 replies] Last: Hi, Thanks, changing to g++ did indeed help and the error is gone now... (by zolo)
C++ read file into adjacency matrix
 
Hi guys, I want to apply the shortest path method (Dijkstra algortihm) to the following file: PROCESS1,-3.88,Start,A PROCESS2,-5.2,Start,B PROCESS3,-7....
[2 replies] Last: std::string field; std::getline(std::cin, field, ','); that will read... (by ne555)
How would I solve this equation
 
So A is simultaneously equal to 5, 0, and 250. Where's the quadratic part? (Also, this is, y'know, a C++ forum. Please look for math homework help elsewhere. G...
[no replies]
by Ganado
constexpr string_view length
 
Anyone know why this doesn't compile in C++17? The compiler is telling me that my that I'm calling a non-constexpr length() function. call to non-constexpr f...
[3 replies] Last: foobar_checker< foobar().length() >() ; compiles cleanly on MinGW w... (by JLBorges)
Competitive Programming Problem
 
Angry Cows ========== Bessie the cow has designed what she thinks will be the next big hit video game: "Angry Cows". The premise, which she believes is comp...
[4 replies] Last: > Why is the value of min incorrect you limit the radius R to the rang... (by ne555)
by GisiNA
C++ program calls template function inside DLL
 
Hello you all! I'm trying to pass parameters to a DLL-Funktion and get a return-value from it. My code does not return any Error-Message. But it does not wor...
[3 replies] Last: Now I have a new question. Is it possible to have a template-Funktion... (by Niccolo)
Getting an error “terminate called after throwing an instance of 'std::out_of_range'”
 
I am doing a challenge questions from LeetCode and I came across this question. Given two non-negative integers num1 and num2 represented as strings, return ...
[8 replies] Last: This got my creativity going so I tried (without looking *anything* up... (by jonnin)
by turqo
pattern search code help
 
Hi, could someone help me finding a way to do the following: if I have a pattern like 0100101000 I want the out put like 00100010000 its like the s...
[7 replies] Last: You can indeed do something like that ... but it is like scanning all ... (by lastchance)
August 2019 Pages: 123456
  Archived months: [jul2019] [sep2019]

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