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'...
[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? ...
[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...
[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...
[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...
[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...
[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; ...
[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, ...
[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...
[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...
[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...
[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...
[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...
[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...
[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?...
[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 !...
[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...
[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...
[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...
[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....
[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.