Beginners - May 2020 (Page 6)

Have I correctly implemented this copy constructor for a dynamically allocated array?
 
Hello, From my header I have got a warning Warning C26495 Variable 'ComplexMatrix::Arr' is uninitialized. Always initialize a member variable (type.6)R.H 64 ...
[13 replies] Last: That was really insightful. Thank you! I was a little aware that it wa... (by jonnin)
Custom Function Question
 
Hey y'all, I'm wondering if there is a way I can combine the two Convert functions into one. So for instance instead of having a ConvertFt and ConvertIn func...
[8 replies] Last: Hello noblemin, As jonnin first said "depends on what you mean and... (by Handy Andy)
It is a taxi dispatch problem could anyone help with Logical errrors !
 
#include<iostream> using namespace std; struct Queue{ int nwaiting,Front;// nwaiting is the no. of drivers waiting . /...
[6 replies] Last: You are assigning the arrays of elements with the starred statement ... (by markyrocks)
Using User Input to Determine the Overall Path of the Program
 
Good day, Everyone! For those who may have seen my posts last month: I'm still in the midst of my D&D Character Generator. While I'm still fiddling with fun...
[4 replies] Last: int che; //Choice for whether the user wants totally random or optim... (by dhayden)
by konoza
Difference between these functions.
 
Can you help me understand the difference between setx, sety, and setz functions please. I am especially confused about the Test &setx(int a), and what referenc...
[1 reply] : All three of them set x to the particular a value given. The differenc... (by Ganado)
by hbcpp
When will this code fail? std::vector implementation constructor
 
I have successfully implemented (not sure if 100% correctly though) the std::vector, and when implementing SFINAE I tried a code out of curiosity and it oddly w...
[2 replies] Last: Ok, Thanks (by hbcpp)
Decimal >> hexdecimal
 
I need assistance converting a decimal number into a hexdecimal. I've .txt file with data : 2 3 // these numbers are used for outputting the results (2 collumn...
[5 replies] Last: ( n < b ? "" : base( n / b, b ) ) If n is less than b then this part... (by lastchance)
Dynamic memory allocation problem
 
Write a program in that file to obtain nutritional information about several foods from the user then display a table containing this information. The number...
[2 replies] Last: Please do not double-post: http://www.cplusplus.com/forum/general/2706... (by Ganado)
Binary Calculator
 
hello there, i'm searching for a binary calculator for addition, subtraction, multiplication, i have been searching for a while and not found a simple one, near...
[4 replies] Last: a simple one would just jack text input and text output into the numbe... (by jonnin)
how to make my snake move?
 
am trying to make snake game. I stuck with a small problem. without making any input, program wont proceed for next step. I need to keep the keys pressing t...
[12 replies] Last: Pretty sure turbo has a nonblocking I/O in there. But yes, a modern ... (by jonnin)
segmentation fault - pointer handling
 
I am new with C, and I am having problems with this simple code. I get segmentation fault when run. Can someone please help me understand the problem her...
[3 replies] Last: A pointer is treated like any other variable. If you pass it by value,... (by Repeater)
by hbcpp
Implementing SFINAE (1,2)
 
I am trying to implement std::list and I am at the beginning and stuck on a constructor that take two iterators. In that constructor is where I shall impleme...
[36 replies] Last: ;) (by hbcpp)
by sparki
Flat tuples
 
Hi, are there any examples of 'flat tuple' implementation instead of 'recursive tuples'? I am looking all over the internet, and I am not able to find them. If ...
[4 replies] Last: Oh! I found it!!! https://stackoverflow.com/questions/4041447/how-is-s... (by highwayman)
How can I assign variables to a derived class from the base class within a constructor?
 
Hello, I have declared 2 classes, 1 for a matrix and another for complex numbers. I would like to use a constructor to dynamically allocate the array and th...
[9 replies] Last: #pragma once #ifndef COMPLEXNUMBERHEADERDEF #define COMPLEXNUMBERHEA... (by TheToaster)
Error in assigning complex numbers to a class object array of complex numbers
 
Hello, I have an object which is an array of complex numbers. I wish to create a member function to assign real and imaginary numbers to each element. Whils...
[2 replies] Last: Hi, You know I had the same problem with the previous member functio... (by Shishykish)
Draw square
 
Hello There, How do i Write a program that draw a square of stars ( * ), the length of square will be entered by the user. and i have to use a void function...
[10 replies] Last: and i know if the "if statement" is only one line no need for "{}" bu... (by MikeyBoy)
Read a file line by line and populate an array
 
Hello, I'm trying to make the following code running, but I'm just wasting time. I need a simple procedure for reading a text file (of some hundreds of lines w...
[7 replies] Last: My suggestion here is, Instead of writing code for all problem stateme... (by akash16)
by annw3y
Smart Pointers
 
Create a class template SmartPointer that should contain a pointer to any object and delete that same object when the destructor of that class is called. Does...
[3 replies] Last: @akash16 ... generally when you are answering a question, try not to j... (by highwayman)
Data types
 
Hello everybody. What is the Long64_t data type? I had search about it but I didn't find it. I wanna to know its length and when it can be use?
[4 replies] Last: You say you did a search and couldn't find anything. I did a search (... (by deleted account xyzzy)
Hash table, need help badly.
 
Okay, so my assignment is to read the file "CityOut.txt", specifically the entries for the "city" and "state_id" on each line, then put those two values into a ...
[5 replies] Last: Okay, so I moved the cout statements into the if, and the output looks... (by Knellith)
May 2020 Pages: 1... 45678... 17
  Archived months: [apr2020] [jun2020]

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