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

Include debugging feature in makefile
 
Hi, I would like to add a debugging feature in a makefile (flag -ggdb of g++). A quick and dirty solution worked only partially. Debugging was possible but th...
[2 replies] Last: Works nicely! Thanks!! (by pfannmoe)
extract diagonal elements from a matrix
 
Hi, I would like to extract elements from the main diagonal and a diagonal line that is 1-step after the main diagonal and 1-step behind the main diagonal of m...
[4 replies] Last: Thank you for your help. (by nurulhudaismail)
class scope
 
Hi guys, in terms of scope , getPersonOne is valid, getPersonTwo is invalid or can cause undefined behaviour, but getPersonThree in Person this is tricky, so...
[6 replies] Last: As @coder777 pointed out, I made a mistake in my code example - I got ... (by Niccolo)
Simultaneously sorting Vector elements alphabetically and ignoring integers in sort.
 
I am attempting to sort a vector of string elements in alphabetical order, outputting them using an iterator. The Vector elements are in the following format: ...
[7 replies] Last: My lips are sealed. I hope the llama survived. (by dutch)
Convert xls file into a xlsx file
 
Hello, Is it possible to convert a Excel file from *.xls into *.xlsx in C++? But not in C# using .NET Framework. And without using instances of Microsoft ...
[8 replies] Last: BTK anyone? Foiled by metadata! pretty much lol. Take a look though ... (by jonnin)
My program shows function declared as void
 
WritMy program shows function declared as void .The program is about library system . User can enter books ,cost and auther name and book id and after entring d...
[2 replies] Last: Also, at line 75, an | is the bitwise OR-operator. If you want to ch... (by nuderobmonkey)
Need help encrypting/decrypting a sentence. ascii
 
Write your question here. c++ ascii issue. I am only able to encrypt/decrypt 1 word and my assignment is asking my to do the sentence "MEET ME AT 8." I don't k...
[2 replies] Last: Salem c is right, "cin" is splitting the sentence you input for each s... (by Zaap)
by kitfox
How to create list of classes at compile time?
 
I'm trying to figure out a maintainable way to have an XML loader be able to lookup loaders for subsections of a document based on a string key. I have a dat...
[5 replies] Last: Thanks for your suggestion, Niccolo! This is exactly what I was looki... (by kitfox)
calculate average of a diagonal line of complex matrix
 
Hi, I would like to calculate the average of the diagonal elements of a matrix. May I know which part that I need to do a correction? I have no idea why the div...
[4 replies] Last: Thank you so much . It works. (by nurulhudaismail)
Getting an error while initializing the size of an array
 
I have a following function "arrayMerger" and I want to add up size of two arrays and then assign its size to another array but I got an error as "expression mu...
[3 replies] Last: The standard library has std::merge() https://en.cppreference.com/w/... (by JLBorges)
How to add a diagonal elements of a complex matrix ?
 
Hi, I would like to add the diagonal elements of a complex matrix. Unfortunately, it only computes the sum of the real part only, while the ima...
[2 replies] Last: Thank you. I am sorry for this silly mistake. I admit that I checked... (by nurulhudaismail)
Undefined reference with namespace, can you help me ?
 
I'm creating an app which need the creation of a namespace, but I've a beautiful undefined reference at the first compilation when I'm using this namespace in m...
[2 replies] Last: Thank you a lot ! I missed this error :( (by LeFanDOst)
by Zaap
Crazy encrypting algo (1,2,3,4)
 
I made a server/client network program with encrypted communication. I generate a key (ex: 49523851). (Actually it's four keys that I concat in one). To ...
[61 replies] Last: This is not help, Zaap. It's self-help. One day I can start socket pro... (by Emil Enchev)
Competitive programming
 
can someone help me solve codechef long problems please? :(
[10 replies] Last: I'd stay away from codechef. To me, those problems are really contrive... (by jonnin)
Passing array to function
 
Hi guys, How I can pass array of one type(lets say uint8_t) to function as parameter with different type(lets say uint64_t)? I'm trying to make function that wi...
[4 replies] Last: > I'm trying to make function that will split array of values into byt... (by JLBorges)
Help
 
I need a help, I don't know what to write in int main() in this program to get array and sum of frist r elements: struct FenwickTree { vector<int> bit; ...
[1 reply] : First, please use code tags. They make posted code easier to read. See... (by keskiverto)
Compilers, bit operations, and data alignment
 
Lets say I have some struct compiled for a 64 bit processor: struct MyStruct { __uint32 d1; __int32 d2; __uint64 d3; }; I know that sizeof(MyStruct) will...
[7 replies] Last: Thanks everyone for the info. It was helpful. One last question thou... (by primem0ver)
by vroll
Binary Search not returning properly
 
I'm trying to do a binary search that returns the location in a vector, given the element content. (EX. i = 4, given 4 the program returns 0.) int findElemen...
[2 replies] Last: you make recursive calls, but don't use their result also, the index i... (by ne555)
Should = default constructor be noexcept?
 
If I make a constructor = default : Object::Object() = default; should I mark it as noexcept ? Object::Object() noexcept = default; ...
[2 replies] Last: The defaulted default constructor is implicitly non-throwing unless -... (by mbozzi)
pushback error using vectors
 
would appreciate som wisdom on why the code has an error on a pushback function. all help or info on how to resolve is welcome. ERROR IS ON LINE 178 //HEADER...
[2 replies] Last: rioLoc should be a vector of strings. What this function should do is ... (by javyesco)
July 2019 Pages: 12345
  Archived months: [jun2019] [aug2019]

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