
please wait
by imastruggler
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't understand why it looks like that though. How did 9 get ah... |
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? struct a{ // Why does this not work? a(int ... |
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 need to add. #include<iostream> #include<vector> usi... |
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 width_, height_; int x_, y_; WINDOW *win_; public: P... |
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 working on the decompressor. I ran into a problem where i see t... |
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<class T, int N> int array_size(const T (&a) ) { retu... |
May 5, 2017 at 6:53am
[5 replies] Last: Thank you so much everyone. I was able to understand this one better. ... (by anantkaushik89)
|
by imastruggler
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; } } ---------------------------------------- int... |
May 5, 2017 at 3:48am
[4 replies] Last: I get it now. Thanks so much! (by imastruggler)
|
by khoavo87
need check !
|
Write a program that keeps track the Lemonade sales for five weekdays: Monday, Tuesday, Wednesday, Thursday, and Friday. It should use two parallel five-elemen... |
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 correctly. My code is listed below, can someone point out what i'm ... |
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 figure out why. I don't know how to approach this. Any body a... |
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 when I try to follow the logic of the program, I do not underst... |
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)
|
by lrichwine
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 see how many of them are alive to determine if the next gen. ... |
May 4, 2017 at 7:59pm
[no replies]
|
by landlord2017
max() of two vectors
|
I thought max() function is to get the maximum between two values. But today I saw it can take in two vectors as below: vector<int> a,b,c; c=max(a,b); ... |
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 getDays(days1)to function advWeekend(person,day) i cannot see... |
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)
|
by gameguy8888
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? W = 13.12 + 0.6215t - 11.37v^016 + 0.3965tv^0.016 ... |
May 4, 2017 at 2:49pm
[4 replies] Last: Strongly favour std::sqrt() for finding the square root. http://en.c... (by JLBorges)
|
by xThomas
Array of 52, error with swapping values of indexes
|
#include <iostream> using namespace std; // swap function void xorSwap(int* x, int* y) { if (x != y) { *x ^= *y; *y ^= *x; *x ^= *y; } } int main() ... |
May 4, 2017 at 2:30pm
[2 replies] Last: ... (by gunnerfunner)
|
by learner47
Need a bit Pointer help
|
Hello every1.. i am trying to sort an array of n elements through pointers. While compiling it gives me this: Compiler & Linker output: Undefined reference to '... |
May 4, 2017 at 11:59am
[2 replies] Last: Thank you so much... (by learner47)
|
by j0091997d
Writing programs using functions
|
My compsci professor is very kind, however... he is not the best professor and many of us are struggling with the concepts, seeing as we went from visual basic ... |
May 4, 2017 at 7:24am
[2 replies] Last: 1. Implement a function that returns an integer that is one greater t... (by Thomas1965)
|
by kingkush
Parse issue expected { or ,
|
I'm writing a derived class which calls the superclass constructor but im getting this issue and I cant seem to figure out why. It occurs at line 9 #include<s... |
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)
|
by lisagimros
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. And I must use constants for Mets values and I also must us... |
May 4, 2017 at 4:54am
[1 reply] : #include <iostream> #include <iomanip> int main() { // use const... (by JLBorges)
|