Beginners - March 2019 (Page 15)

Description of the steps
 
Can someone please give me description of the steps. r=new double* ; z=new double* ; T=new double* ; TOLD=new double* ; qr=new double*[jmax-1]; qz=ne...
[2 replies] Last: It allocates a bunch of memory to very badly named variables. I'd ad... (by closed account E0p9LyTq)
CHDIGER
 
https://www.codechef.com/MARCH19B/problems/CHDIGER #include <bits/stdc++.h> using namespace std; int main() { int t; long long int n, l; int d; ...
[3 replies] Last: that's because you are invoking undefined behaviour by accessing `c' o... (by ne555)
Function Overloading - Amiguity
 
I know this will be simple for someone, but I would appreciate some insights as I don't quite understand what's going on. I'm just playing with some code I c...
[2 replies] Last: Thanks for the explanation @mbozzi. I'll read the info' at the links. (by Cheddar99)
Structs
 
I am taking an online class and, unfortunately is no online lecture both either written or video to go online with it. Just an assignment and the textbook. I ha...
[7 replies] Last: You don't need that pointer. Furthermore, the syntax: ptr->countLette... (by keskiverto)
Performing signed arithmetic on unsigned variable without storing value in another signed variable
 
Hi, I am trying to see if it is possible to perform signed arithmetic on a short unsigned variable. Is this possible or do I have to store the unsigned value...
[3 replies] Last: #include <iostream> #include <climits> int main() { static_asser... (by JLBorges)
Assigning values to an existing vector
 
If a vector v has already been defined. And only later on you want to reassign values to that vector, would you be able to assign values to it as such or is the...
[1 reply] : std::vector<int> vec { 0, 1, 2, 3, 4 } ; vec = { 15, 16, 17, 18, 19,... (by JLBorges)
by kibasu
Creating a class for c++ Challenge
 
So basically I have to create a Class called Date. I've been looking through my resources and I'm just completely lost in my class no matter what I do. I have j...
[2 replies] Last: The conditions in your setXYZ() methods are wrong: void setDay(int d)... (by dhayden)
by AL88
I think I got this logic wrong
 
Hi I'm trying to write my own database program for strings that sorts them alphabetically and writes them to a file. I'm fine with the text file stuff but the a...
[3 replies] Last: Thank you so much for your help. I am awful at logic. (by AL88)
by Myro
Global Var & multifunction
 
well as my class makes there foray into Chapter 6 this assignment has me stuck i can easily accomplish the task in one function #include <iostream> #includ...
[4 replies] Last: Thanks coder77 i was able to fix it with that explanation (by Myro)
How to have a class array with non-static, const dimensions?
 
What I'm interested in is creating a class that defines two consts and creates a 2D array with these. The catch is that I don't want to use static for the const...
[16 replies] Last: @Enoizat Thank you for your swift reply. It makes more sense to know... (by closed account Ezyq4iN6)
cannot conver 'node*' to 'node**'
 
I'm new to pointers and can't solve this error "cannot conver 'node*' to 'node**'". What is the problem here? #include <iostream> using namespace std; ...
[1 reply] : You pass a pointer as an argument where a 'pointer to pointer' is requ... (by nuderobmonkey)
need help to direct my approach
 
.
[6 replies] Last: wowisay, STOP deleting the content of your posts. It is rude and unhe... (by closed account E0p9LyTq)
HELP PLEASE-Chef and a Beautiful Digit
 
append the digit d to the decimal representation of N (d becomes the least significant digit of N), then remove one occurrence of one digit from the decimal re...
[5 replies] Last: yes. I got mine fixed but I do not like it. I ended up finding the ... (by jonnin)
by AL88
Why is the section to write the text file to the screen not producing any output?
 
Why is the section to write the text file to the screen not producing any output? It works fine when isolated on its own, the code is at lines 140-153. #...
[2 replies] Last: also try return(1) instead of exit(1). Exit is like pulling the cord ... (by jonnin)
Static vs Dynamic Linking
 
Hey everyone! I wanted to get your thoughts regarding static vs dynamic linking. Basically, when should I choose one over the other? Thank you.
[16 replies] Last: Yes, I am well aware of how to compile linux source code. The main pro... (by colt)
Problem troubleshooting my "date" class
 
Hi, I am having some issues to print some data in my program. I have created this class which takes in the day, month and year and will return the indvidual...
[11 replies] Last: Honestly, I only understand the #include to call header and source fi... (by jlb)
Not being able to pass char array as an argument of a class
 
Hi everyone, I have encountered the problem of not being able to pass a char arraray as a parameter into my class, I get the error "prototype for "Employee::...
[5 replies] Last: Where are the modified class files? Did you change your header file t... (by jlb)
by birb
Equal elements in linked lists
 
Hey, I am working on a school project and I'm supposed to write a function checking if two doubly linked list contain the same elements. Obviously I could do it...
[5 replies] Last: It doesn't matter what type of data is in the lists - int, double, str... (by lastchance)
Need help troubleshooting 2D array (1,2)
 
I've really been struggling to write a program that finds local peaks/max values in a data file using a 2D array. I keep on getting values that are incredibly s...
[28 replies] Last: By the way, what does it mean when you say maxPeak = 0.0? Are you as... (by closed account E0p9LyTq)
Help with Time Complexity of a Problem.
 
. Let's define an array B as S concatenated with itself m times, where m is the smallest integer such that m(r−l+1)≥K . Next, let's sort B and define X=BK...
[3 replies] Last: dave please explain what is Q in "You need to observe some pattern i... (by jayasai)
March 2019 Pages: 1... 1314151617... 25
  Archived months: [feb2019] [apr2019]

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