Beginners - February 2020 (Page 13)

Lvalue reference vs object data member.
 
I have a bit of a problem in my code. Here is a simplified class that portrays the kind of problem I am facing: template<typename T = myCustomDataType, ...
[3 replies] Last: Like this: template <typename C, template <typename...> class TT, typ... (by mbozzi)
Dynamic 2D Array
 
Can someone explain how this works? I'm a little confused with the pointer to a pointer idea int **memo = new int* ; for (int i =0; i<rows; i++...
[7 replies] Last: How does that help? it puts all your data in one solid block. that me... (by jonnin)
Trees ( other than Binary trees)
 
Hi guys, so I've come across binary trees and ternary trees plenty of times, and I've heard trees been talked about but I've never come across code that work...
[7 replies] Last: a generic tree becomes just a special graph Good point. https://en.w... (by dutch)
by nickg
Simulate a Beta dist from 2 Gammas
 
C++ evidently does not include a beta random distribution. However, a Beta(A,B) can be simulated from two gammas: GammaA = Gamma(A,1) and GammaB = Gamma(B,1), b...
[2 replies] Last: Thank you again. I'll try your alternative. I did think my code was on... (by nickg)
Levelorder Traversal
 
Given a binary tree, write a function to perform a level order traversal and return a vector of integers containing the data of the visited nodes in the correct...
[4 replies] Last: Thanks dutch (by Vijay0753)
write large array to binary file
 
i have built a bread board computer and am currently at the point of programming the instruction logic. i have built an array to define all my instructions. thi...
[14 replies] Last: So, continuing along on that theme we get: #include <iostream> #incl... (by againtry)
Can't read in data separated by delimiters
 
I'm working on a project for my cs162 class and am having some trouble. For part of my project I have a .txt file with a list of song attributes seperated...
[14 replies] Last: cout << "Enter Artist to search for? "; cin.getline(buffer, ... (by againtry)
"multiple definition of function" linker error
 
I have 2 cpp files that declare and define a function with the same name. When I try to compile I get the following linker error: func2.cpp:(.text+0x0): mul...
[2 replies] Last: Ahh thank you so much mbozzi - static was what I needed. Somehow I'v... (by Norm Gunderson)
problem in the internal loop
 
I have a piece of code like below. when I run code, "cout" shows on screen that the internal loop just one time run (for linenoq = 0). I mean when linenoq is eq...
[2 replies] Last: Dear salem c, so many thanks for help. Indeed, I did not pay attention... (by leelion)
by Tsirp
Exchange Calculator using classes
 
I am a beginner in wit c++ and would appreciate some friendly advice. I made a exchange calculator from EUR to a chosen currency and I have to use classes. I...
[2 replies] Last: I overworked your program, now it's split into several functions. The ... (by nuderobmonkey)
by nickg
Reading and writing to files
 
I'm new to C++. I use Visual Studio 2019. I am trying to program a simple program that simulates a sample of normal random variables by reading the parameters (...
[5 replies] Last: Thanks to dutch and last chance. This helped me greatly! (by nickg)
Keeping data for text file
 
Hey so I have a program in which I enter in a name of a student and insert all the percentages for each class. After that I transfer it into a text document, bu...
[6 replies] Last: Oh I see! Thank you for that! (by Deadweight77)
by mr55
Html Question, Sorry DOnt mind if you are not interested
 
Im really sorry for posting this Yall people respond quickly about c++ stuff , i guess i can try for html sorryyyy IF someone can help me about html css javas...
[5 replies] Last: window.location.replace('http://w3c.com'); It’s better than using... (by galewinston)
Bubba ADD??
 
The professor was going over characters and strings in our last class and didn't explain to well what/how/why we are doing this program. I'm sure it's leading u...
[14 replies] Last: What do you mean by benchmark the code? You want to make sure you're... (by againtry)
Program runs fine doesn't want to compute
 
A new program I've been working on for a week now and wanted to get some advice on what should be altered for it to run properly. This isn't all my code, I've h...
[8 replies] Last: Yes, it feels great. It's always hard in the beginning, but as soon as... (by CodeNovice01)
Need Help Please Cash Register C++
 
Hi, I've been working on this program for approximately 2 weeks and I just can't do it, I'm a beginner it's really difficult for me and I don't know what to do...
[1 reply] : you may try this code: #include <iostream> #include <iomanip> #inc... (by Wail)
February 2020 Pages: 1... 111213
  Archived months: [jan2020] [mar2020]

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