[try Beta version]
Not logged in

Beginners - May 2017 (Page 21)

How do you get the array after the third swap of bubble sort algorithm?
 
int jumbled2 = {5,9,50,6,1,70,0} It's in ascending order and the answer is 9,50,6,5,1,70,0. I don'...
May 5, 2017 at 2:08pm
[3 replies] Last: The original post: int jumbled2 = {5,9,50,6,1,70,0} It's in ascending... (by lastchance)
by arbwok
Question about struct
 
I can't understand why I can't create a constructor in struct. Is that only available for classes? ...
May 5, 2017 at 12:18pm
[3 replies] Last: Are you using C or C++? C doesn't have constructors. (by Peter87)
Help adding vectors to a vector of vectors
 
I need to add vectors to a vector of vectors, however, I don't know in advance how many vectors i ne...
May 5, 2017 at 11:28am
[5 replies] Last: max: nicely put, thank you. The new std::vector<int> syntax is from ... (by gunnerfunner)
by bibibi
source file split
 
How do I split this source file into suit multiple files? class Pane { protected : int wi...
May 5, 2017 at 10:02am
[1 reply] : Well, the obvious way would be to put each class definition into its o... (by MikeyBoy)
problem with huffman tree recreation
 
I have made up to this point a huffman compressor with the help from @TheIdeasMan and now i am work...
May 5, 2017 at 7:53am
[9 replies] Last: Never mind no help is needed atm, i solved the problem. Once i finish ... (by globaltourist)
Doubt in template syntax
 
Hello I was reading an article about cpp templates, and I found this syntax given. template...
May 5, 2017 at 6:53am
[5 replies] Last: Thank you so much everyone. I was able to understand this one better. ... (by anantkaushik89)
How do you find the values of x and y?
 
void refVarFunc(int1 &Num1, int num2) { for (int1=0;i<5;i++) { num1++; num2 +=2; ...
May 5, 2017 at 3:48am
[4 replies] Last: I get it now. Thanks so much! (by imastruggler)
need check !
 
Write a program that keeps track the Lemonade sales for five weekdays: Monday, Tuesday, Wednesday, ...
May 4, 2017 at 10:45pm
[1 reply] : What error message are you getting? The problems calls for an array o... (by wildblue)
Having a minor issue with my program
 
I'm working on a vending machine program but i'm having trouble getting it to output change correctl...
May 4, 2017 at 10:39pm
[4 replies] Last: Ah I see, thank you :) (by cplusplusnewb89)
by Caruso
two array's in Struct
 
I'm preparing for C++ institute exam. One of the questions is below. The outcome is 34 but I can't f...
May 4, 2017 at 9:55pm
[1 reply] : The topic is aggregate initialization. http://en.cppreference.com/w/c... (by mbozzi)
by dubley
Question about for loop increment
 
This program, from Stephen Prata's C++ Primer Plus, outputs 2! = 2, which I know is correct. But whe...
May 4, 2017 at 9:24pm
[2 replies] Last: I see. So in the program the first loop tests and executes all of the ... (by dubley)
Conway's game of life
 
I need some help with a project, we are working on class and i need to count a cell's neighbors to s...
May 4, 2017 at 7:59pm
[no replies]
max() of two vectors
 
I thought max() function is to get the maximum between two values. But today I saw it can take in tw...
May 4, 2017 at 6:07pm
[4 replies] Last: yes, it's a lexicographical compare, just like in a dictionary (by gunnerfunner)
by ATh
how to pass values of variable received from function A to function B
 
I am trying to pass value received by variable person and day from function getPersons(person1)and g...
May 4, 2017 at 4:50pm
[3 replies] Last: I have updated the program the way i was expecting how it should work ... (by ATh)
How do I make formulas with exponenets?
 
How do I make formulas with exponenets? I want to make this into a formula, how do I go about it?...
May 4, 2017 at 2:49pm
[4 replies] Last: Strongly favour std::sqrt() for finding the square root. http://en.c... (by JLBorges)
Array of 52, error with swapping values of indexes
 
#include <iostream> using namespace std; // swap function void xorSwap(int* x, int* y) { if (x !...
May 4, 2017 at 2:30pm
[2 replies] Last: ... (by gunnerfunner)
Need a bit Pointer help
 
Hello every1.. i am trying to sort an array of n elements through pointers. While compiling it gives...
May 4, 2017 at 11:59am
[2 replies] Last: Thank you so much... (by learner47)
Writing programs using functions
 
My compsci professor is very kind, however... he is not the best professor and many of us are strugg...
May 4, 2017 at 7:24am
[2 replies] Last: 1. Implement a function that returns an integer that is one greater t... (by Thomas1965)
Parse issue expected { or ,
 
I'm writing a derived class which calls the superclass constructor but im getting this issue and I c...
May 4, 2017 at 5:10am
[9 replies] Last: I figured it out trying to copy the error lol, When i double clicked i... (by kingkush)
Constants and switch statement? - C++ beginner programming
 
Hi. I'm doing an assignment for school and it says that I must use constants for the menu choices....
May 4, 2017 at 4:54am
[1 reply] : #include <iostream> #include <iomanip> int main() { // use const... (by JLBorges)
May 2017 Pages: 1... 192021222324
  Archived months: [apr2017] [jun2017]

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