General C++ Programming - December 2019 (Page 6)

by volang
Increase stack size. Why is it bad?
 
I want a function that creates a char array that can handle 1GB data, because I like idea that allocation and free gets handled automatically. If it's NO...
[15 replies] Last: I've read/seen some opinions from "experts" that using exception hand... (by Repeater)
Modify a tree to get edge weights less than vertex's values
 
So, this question goes like this: Given a weighted tree with values assigned to each node, you are allowed to 2 free and 1 paid operation: Free i. Swap any...
[no replies]
How to remove xml declaration <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
 
Hi All, I am using xerces for XML parsing. After parsing in new XML file I am getting below is a first line but i dont want it. "<?xml version="1.0" encodi...
[5 replies] Last: I want to read data on one of tag in CDATA section. But unable to pars... (by akash16)
Why need a size_type arg in deallocate function?
 
In alloctor<T> Class as a member function, there is a deallocate(). void deallocate(_Ty* const _Ptr, const size_t _Count) I thought it works like dealloca...
[3 replies] Last: Thank you for answers, guys! you helped me. (by woohyeon)
Questions for DP and recursion
 
Hi, I have a few questions about these two algorithms. Below is my recognition. Recursive is a kind of algorithm that the highest problem will be calculated ...
[1 reply] : I will circle back on this but right away: recursion can be used in a ... (by jonnin)
what is the raw memory?
 
Hello. I'm studying about allocator<T> class and I saw the word "raw memory". What is the meaning of raw memory exactly? It's just memory block of bytes and ...
[2 replies] Last: // JLBorges Thank you. (by woohyeon)
by volang
Append/concat strings and char arrays
 
I have a char array(400MB-1GB) and need to have another string(300 chars) appended to the beginning of it. I could append "the char array" to the smaller strin...
[2 replies] Last: Why not keep the 300 bytes where it is? You really shouldn't need to ... (by kbw)
Getting specific amount of values from the line
 
As title says, I need to get the specific amount of values from the input file’s line. The amount will be input, so program will know it. I have the following...
[6 replies] Last: The code that you posted is not an infinite loop, although it's possi... (by yucecoder)
Memory allocation problem
 
Dear all, I'm studying C++ and now I started implementing a code to solve some numerical methods. I created a Matrix class (2D with contiguous memory allocatio...
[6 replies] Last: Thank you ne555! As I'm a beginner, it would be great to count with y... (by nunesanderson)
function's argument alias for any type
 
How is the mechanism of a function's argument alias for any type, just like pointer to void function argument is a pointer for any type?
[1 reply] : @Ganado gave you a response in the other thread you opened. Why did y... (by doug4)
XOR of permutation of strings
 
This is a competitive programming question I came across, but couldn't solve. The question gives two inputs: two strings A & B of length N, consisting of onl...
[2 replies] Last: ^^ you should find a way to directly compute the result (by jonnin)
by volang
How do I store a returned class? (1,2)
 
auto test(){ class yo { public: int a = 2; }; yo yo1; return yo1; } int main(){ ? = test(); }
[23 replies] Last: Peter87 used a C++17 class template - std::optional - that manages a... (by George P)
Functions in a STACK header
 
void DynIntStack::OddOrEvenPrint() { StackNode *currentNode; StackNode *nextNode; int stackOdd =0; int stackEven = 0; if(isEmpty()) { std::cout<...
[3 replies] Last: For the reverse print function I have: // implemented reverse print ... (by CodingIsHard17)
by nik000
Non riesco ad acquisire con getche()
 
#include<iostream> #include<conio.h> #include"C:\Users\Nicolas\Documents\MEGAsync\funz.h"//libreria di funzioni personale #define N 8 using namespace std; ...
[2 replies] Last: if(y !=0 || y !=1){ This is always true. Sempre vero. y == -1 ? ... (by Ganado)
Cache Friendliness
 
Rob and Jason are joined by Björn Fahller. They first discuss articles on the C++ ABI and a blog post on performance analysis. Then Björn talks about cache fr...
[2 replies] Last: Maybe the person doing the reporting believes topics that only adverti... (by George P)
by Dee5
Taking inputs (1,2)
 
Recently I've been helped on making a program which counts numbers found in a string. A little problem though..I'm stuck on how to enable user to Input the str...
[21 replies] Last: Thanks for the help. (by Dee5)
by volang
Setup of multithreads
 
I'm still a little unsure how to set up my threads. I need multithreads because the server receives large file uploads, which can cause new requests to be bl...
[4 replies] Last: Thanks all. Jonnin: Big thanks. I'll probably go with the mixed versi... (by volang)
I need a hand with a program
 
Hello, I need to write this program a) The first two numbers indicate the size of the matrix - rows, columns, the next numbers in the quantity being the prod...
[5 replies] Last: I started to go there but that does not make sense, you wouldn't injec... (by jonnin)
a string array being passed to function alias arg
 
How do we handle a string array being passed to function alias argument. (not simply just argument but its alias) ?
[1 reply] : What is a function alias argument? Do you mean a reference parameter? ... (by Repeater)
reading and putting numbers in an array
 
the code works just fine until it reaches the output of finding the small number then it just stops can anyone help me out me out #include<iostream> U...
[no replies]
December 2019 Pages: 1... 45678... 10
  Archived months: [nov2019] [jan2020]

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