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

Repl.it - String Error
 
Hi guys I use repl.it c++ online IDE to practice my coding. I have some issues. 1) When I include <string> the IDE does not let me use strings. Does anyone...
[3 replies] Last: You'll get substantially better help if you provide a small, reproduc... (by mbozzi)
Basic vector qeustion
 
What does the mean? vector<int> desks ;
[7 replies] Last: @afatperson, It would probably move the discussion forward in a bette... (by Niccolo)
FINDING MAX VAL IN A OBJECT
 
Hi A vector contains a few object, in those objects a certain member type is age which is a number. How to find the max age from the vector of objects using ...
[2 replies] Last: You know about the algorithm and thus you can read: http://www.cpluspl... (by keskiverto)
Set Insert Iterator?
 
fin >> k; gr.insert(--k); what does this code mean?
[9 replies] Last: fin >> k; gr.insert( --k ); is same as fin >> k; --k; gr.insert( k ... (by keskiverto)
Not sure why minute detail causes error in code?
 
#include <fstream> #include <vector> #include <set> #include <queue> using namespace std; vector<set<int> > groups; set<int> gr; vector<int> belong ; queue<in...
[1 reply] : "minute detail" ... not true has only " minute " difference from tr... (by keskiverto)
Forcing programming structure via virtual functions.
 
Hello, I'm developing an extensible software framework, and I'm at a loss about implementing some features of the framework. To summarize, the framework I...
[14 replies] Last: Please don't take my following point as a raw "I told you so", I don'... (by bayindirh)
#Define for building functions alternative
 
Hi, So, I'm working with a piece of code that is not mine, but uses #define SPELL(func) i32b func(i32b level, Charact *ch, Charact *victim, Object *obj, ...
[12 replies] Last: it may also be possible to use the existing code to just generate what... (by jonnin)
Migration of a C++ application to a newer server with latest Redhatlinux version
 
Hi, I need to move an application on a redhatlinux to another server having latest redhatlinux version( details of the version is unknown for the moment). The ...
[2 replies] Last: My suggestion is to just sandbox it. make a new machine with the new ... (by jonnin)
Getting objects through iterators and putting in a Map
 
Hi I have objects of classes in a vector. While iterating through the vector i want to insert each object from the iterator to a map, with some value. How ca...
[10 replies] Last: or provide some comparisonn function just as with std::unordered_map y... (by ne555)
Pass By Reference - Question
 
I know the code below will print “123456”. But I am curious on something. In the ref function parameters it takes in *a which is a pointer. Why can’t ...
[5 replies] Last: If you're asking about when a parameter should be a pointer and when s... (by dhayden)
Topological sorting question
 
Hi, everyone. I'm now working on a topological sorting program, which reads in a data.txt and output the sorting result. However, there are some problems and I ...
[6 replies] Last: std::array needs the size to be known at compile time, not applicable ... (by ne555)
Input file question
 
Hi, everyone! I'm working on a topological sort problem. I have to read in a text file which contains the information of the graph and output the result to anot...
[2 replies] Last: Thanks a lot, that works :)! (by calvinfornia)
Little Problem to connect Compile Instruction
 
Dear Community, I have a little Problem to connect Compiler Instructions for g++ on Linux Ubuntu Mint. The Problem is that I can combine not following instruc...
[1 reply] : Did you look at the output after you ran the command? What did it say?... (by Albatross)
putting an object as condition in while statement (1,2)
 
I am trying to understand how filestream objects work. What does the file passed as a condition in the while loop return wheen running its loop and breaking off...
[29 replies] Last: I suppose my final reply to wrap things up. Eh, I wouldn't rely on a... (by zapshe)
how does the sort from algorithm work?
 
I understand that it sorts a vector in ascending order and you can write your own comparator method to specify the sort order, but how does the sort work behind...
[10 replies] Last: Heh, welcome to the old geezers club. :O) I enjoyed playing with sort... (by Duthomhas)
C native android app crashes on Oreo and above due to signal(SIGALARM) call
 
I have created a C library using Android NDK and created an apk using this prebuild library. This apk calls the foo() function of the library. In this library ...
[2 replies] Last: why stack only? Heap, used as shown above in the static example, is j... (by jonnin)
Topological sort question
 
Hi, everyone. Here is an introduction of topological sort program, There's an input file indicating the layer constraints in the following format: 5 1 2 3 4 5...
[6 replies] Last: 4 < 3 < 1; 2 < 5 alll constraints are respected OK. I think I get ... (by doug4)
by P13r0
Help on a (probably) "custom" CRC
 
Hi all, and thank you in advance for your help. Here's my issue. I was recently given a small router (GO-DSL-AC750), and I'm trying to modify it's firmware. My...
[8 replies] Last: Ok, a good friend of mine did it :) int main(int ac, char** av) { ... (by P13r0)
Get Outlook contacts from C++ application
 
Hi, I need a C++ application to get Outlook contacts (from my local Outlook application) I found this old example: https://www.codeproject.com/Article...
[7 replies] Last: Just if usefull for anyone, I found how to compile the code here: htt... (by ddonate)
Save hex address of a int32 (savepos)
 
how can i save hex address? for example, i have a int32 int32 UncompressedSize ; how can i save position of UncompressedSize block?
[8 replies] Last: Oh! Are you reading into UncompressedSize from a binary file? http://... (by Albatross)
August 2019 Pages: 1234... 6
  Archived months: [jul2019] [sep2019]

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