[try Beta version]
Not logged in

Beginners - July 2019 (Page 6)

A logic explanation about averages
 
Hello, we are writing a homework code about finding the average of odd numbers in an array. Someone ...
Jul 15, 2019 at 2:53am
[6 replies] Last: @ jonnin Yes, agreed that new code is typically fine with doubles. @... (by Duthomhas)
strings to numbers
 
I am trying to input two numbers as c strings, it should be 4 digits long and should contain no let...
Jul 15, 2019 at 12:06am
[16 replies] Last: or the 2 cent answer, std is too big, so its better to do smaller usi... (by jonnin)
by dutch
efficient coding
 
You should get 90 points just for reading that pointless pile of garbage. codechef sucks and teache...
Jul 14, 2019 at 7:50pm
[14 replies] Last: you are messing up the update part. index= 0 1 2 3 4 value= 3 9 10 11... (by ne555)
Why are these codes doing this?
 
Here are two different codes with the same information just about. But each code is different. Each ...
Jul 14, 2019 at 7:08pm
[3 replies] Last: ... (by highwayman)
One-run functions?
 
I’m not entirely sure, but isn’t there a way to make a function so it only really runs once and ...
Jul 14, 2019 at 6:23pm
[9 replies] Last: Sorry that’s supposed to be VARS not CARS so sorry XD thanks for the... (by highwayman)
can vectors be used without invoking copy constructor?
 
Hi I have a vector V which contains objects of type O. Generally, I want to prevent O from being ...
Jul 14, 2019 at 5:05pm
[3 replies] Last: > Is that because std::ofstream has deleted copy constructor/assignmen... (by JLBorges)
To divide the elements into K segments such that the sum of minimum element of each segment is maximum
 
Given an array of N elements divide the elements into K segments such that the sum of minimum elemen...
Jul 14, 2019 at 7:45am
[2 replies] Last: Note that the sample has a second solution: [1,2]+[5,3] The task is a... (by keskiverto)
vector rend call
 
I was expecting following program output 1.But for some reason I am getting output of "201360154". ...
Jul 14, 2019 at 5:43am
[3 replies] Last: About std::vector::rend.... Returns a reverse iterator pointing to t... (by deleted account xyzzy)
Compile time string build function
 
I want to build a string/char in the compile time. constexpr char INPUT = "abc"; // input ch...
Jul 14, 2019 at 3:28am
[7 replies] Last: Here's a very sloppy but still much nicer version in the value domain:... (by mbozzi)
Help stuck in this problem
 
Help me in removing wrong answer in this program? This is the problem: There are N bottles. ith bo...
Jul 13, 2019 at 5:04pm
[1 reply] : Hello counter strike, PLEASE ALWAYS USE CODE TAGS (the <> formattin... (by Handy Andy)
Operations Program, Need guidance
 
I have a program I need to code that: Handles 25 interger numbers. Declares Array A and B. Fill Arr...
Jul 13, 2019 at 4:47pm
[9 replies] Last: @CodeNovice01: Read http://www.cplusplus.com/doc/tutorial/functions/ a... (by keskiverto)
With functions and arrays
 
If I have a program and I need 'Array A' to read in values from an infile, how would I make that int...
Jul 13, 2019 at 4:44am
[8 replies] Last: Jonin, I appreciate the advice, as of right now my professor wants us ... (by CodeNovice01)
Shortening this comparison code the right way
 
This code is inside a while loop and version 1 works, but I guess the code is too big and readabilit...
Jul 12, 2019 at 9:08pm
[4 replies] Last: is this really do { code } while (something and all the combo test... (by jonnin)
by dutch
dsj vjskd
 
I solved only subtask #2 What was your algorithm? EDIT: Original poster has disappeared. ...
Jul 12, 2019 at 8:55pm
[17 replies] Last: don't check every combination, check only the ones that occur between ... (by ne555)
Dynamic cast vs static cast
 
hi guys, again I'm watching one of Jamie kings videos ( https://www.youtube.com/watch?v=0AuPWXuBm...
Jul 12, 2019 at 8:17pm
[8 replies] Last: very true :) (by adam2016)
Function issue
 
Hello everyone, I'm currently learning c++, so still don't understand everything so please forgiv...
Jul 12, 2019 at 6:27pm
[4 replies] Last: No, ::variable would only be need to explicitly reference a variable i... (by Ganado)
Restructuring a GSL matrix
 
I have a set of K*K square matrices and I would like to create a new (K+1)*(K+1) square matrices whe...
Jul 12, 2019 at 3:07pm
[3 replies] Last: I'm not familiar with gsl , but taking a guess, try moving gsl_matri... (by dutch)
by medosz
Factorial with while statement
 
This program reads a nonnegative integer then it should compute and print its factorial with while s...
Jul 12, 2019 at 1:11pm
[1 reply] : Your loop goes one-too-far, ultimately multiplying the result by 0. ... (by dutch)
Help me to understand these sections of code
 
So, i am going through the book 'Beginning C++ Through Game Programming'. I have reached the Hangman...
Jul 12, 2019 at 11:17am
[5 replies] Last: This mean until you get no match. (by Zaap)
Vector crashing
 
Why is my vector program kept on crashing There's the question: 5. Use C++ Standard Template Libra...
Jul 12, 2019 at 9:02am
[13 replies] Last: > so actually we couldn't use assign() function to assign the value 5 ... (by JLBorges)
July 2019 Pages: 1... 45678... 11
  Archived months: [jun2019] [aug2019]

This is an archived page. To post a new message, go to the current page.
Registered users can post in this forum.