General C++ Programming - April 2020 (Page 9)

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 instructi...
[1 reply] : More info than "it wouldn't work" might be helpful. Try g++ -std=c++1... (by dutch)
cout arrays
 
Is there a way to cout an array? void displayPrice(double money ) { for(int i = 0; i < 5; i++)//I am making the array 5 elements { ...
[12 replies] Last: #include <iostream> template <typename T, size_t SIZE> std::ostream&... (by George P)
Help rewriting a 2d array
 
I need to split up a 2D array into a smaller 2D array, where every other column is rewritten to a new array. so .. Originalarray into Newarray . Im having...
[3 replies] Last: Got it! Thanks! (by wallid soukaki)
Using a double linked list in a different class
 
Format:https://www.geeksforgeeks.org/doubly-linked-list/ I am trying to get more comfortable with data structures, so I'm trying out double linked lists. I hav...
[7 replies] Last: Thank you very much for your help. I appreciate it. (by ilikesweets)
*pointers with arrays
 
Hello everyone, If you have a pointer that points to an array and you are making a function. You have your for loop and counter, etc. How does one use the p...
[13 replies] Last: Hopefully, your array is not called "array", since this is a keyword. ... (by zapshe)
Different outputs using URLDownloadToFile
 
Hi, first time here, new programmer. I am trying to download online html pages and then search after specific strings. I implemented code with URLDownloadToF...
[3 replies] Last: Sometimes the html is generated by JS, which the browser executes but ... (by thmm)
Primitive geometry and mesh generation in C++
 
Hello All What I trying to do is , generating some primitive 2d shapes and show in the gui with dimensions which is important. Then I would like to generate 2d...
[3 replies] Last: Oh, I see. I'm not sure of a suite of programming tools for FEM. But h... (by Ganado)
Need Help Sorting Strings From Array By Increasing Length
 
So for an assignment, I have to mod a selection sort algorithm to sort an array of strings by increasing length. I did some work to the point where I can random...
[6 replies] Last: Integer vs string. You create string B. A copy. That is fine. Let me ... (by keskiverto)
by quakig
void** to float** or double**
 
Hi I am new to C++. Here's my situation. I have to create an array of array named m2DArray. It has 2 rows and 5 cols i;e a size of . The array can be `flo...
[7 replies] Last: Then at runtime I decide between float** or double** based on some lo... (by Enoizat)
by doug4
Derived Class with Derived Member Object
 
I want to have a base class that contains a member object. When I extend the base class, I want the member object to be of a type derived from the original typ...
[2 replies] Last: Thanks! That's what I was looking for. (by doug4)
Insertion Sort time complexity is O(n) in Best Case
 
Why Insertion Sort time complexity is O(n) in Best Case? The best case for any sorting algorithm is when input is already in sorted order. Here in such scena...
[no replies]
Bubble sort have O(n) time complexity in best-case
 
Why does Bubble sort have O(n) time complexity in best-case performance? The best case for Bubble Sort Occurs when the given array is sorted array. We will ...
[no replies]
Help passing array to main function
 
#include <iostream> #include <fstream> #include <string> #include<ctime> //for rand and srand #include<cstdlib> //for time function #include<iomanip> //Formatt...
[5 replies] Last: I've managed to workaround this solution with vectors which is probabl... (by Toddinator716)
Help me identify algorithm
 
I am a novice programmer, and I am trying to implement a finite element solution. I think I am trying to solve a common algorithm, but I am not sure what it is ...
[2 replies] Last: My drawing was basically trying to represent a flow chart map. You sta... (by sakonpure6)
How do I implement a variant version of the insert function in an binary search tree?
 
I am trying to implement the insert function in my bst.template file. I haven't implemented anything important as I am confused on what to do. Here's what I've ...
[3 replies] Last: Why does it matter? And where's your attempt? if(item) is not an att... (by dutch)
Ned help regarding passing object referance
 
I have a class whose member is another class' object like below class test { A aobj; void testfunc() { aObj.bObj.printval(&aObj); } ...
[3 replies] Last: similar cyclic dependency asked on http://www.cplusplus.com/forum/ge... (by marhuum)
Efficiency and optimization in assignment inside the condition
 
Is efficiency and optimization in assignment inside the conditional expression quite significant ? How is to pinpoint the real assembly code enhanced efficiency...
[2 replies] Last: It has nothing to do with efficiency. If you remove the semicolon on l... (by Peter87)
Heaps and time complexity
 
Hi guys, so below I have created a minheap, anyhow from what I have read they say that to poll or get the min element ( or max depending on what type of h...
[11 replies] Last: Is that a kind of "amortized time"? I don't think so. The average cas... (by helios)
by DeeMoo
How to make object movement smoother?
 
Hi! My problem is that when i move my board (which is the rectangle) it is very choppy. My board will move a little then accelerate to a smooth movement until I...
[1 reply] : see if you can move less far per go, and reduce the sleep. you should... (by jonnin)
C++ Riemann Sum Problem
 
Hello, The code below is supposed to calculate the area under the curve. I managed to get the code to work by setting delta to 1 or even smaller numbers like...
[2 replies] Last: which begs a general point: you don't usually want to compare doubles ... (by jonnin)
April 2020 Pages: 1... 78910
  Archived months: [mar2020] [may2020]

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