
please wait
by Ramzi89
Recursion and counting/incrementing
|
Hey I'm practicing with recursion. I'm trying to write a function that will count all the nodes in a binary tree. given the following class definition. ... |
Jun 5, 2013 at 11:32pm
[9 replies] Last: I can see whats going on but piecing the actual logic together is anot... (by Ramzi89)
|
int *myPointer = 0 (What's the point of this pointer?) |
What's the point? |
Jun 5, 2013 at 11:32pm
[1 reply] : It's a way to initialize a pointer so that it doesn't contain junk (an... (by xish)
|
Moore's Voting Algorithm |
Hey guys I need help understanding how this code works for finding a majority element in an array. I understand the first main function, and also the bool funct... |
Jun 5, 2013 at 11:21pm
[no replies]
|
by Ramzi89
Abstract classes & Pure virtual functions
|
Hi there. Im still a bit confused by abstract classes. I get the concept but am just a bit confused by the implementation. In the below note the addition of ... |
Jun 5, 2013 at 9:32pm
[6 replies] Last: Constructors cannot be virtual. Wouldn't hurt to try this stuff in a ... (by cire)
|
by zeitgaver
Possibly Data Type Problem
|
Beginner programmer here. This is Problem 3 on Project Euler. The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the ... |
Jun 5, 2013 at 9:12pm
[5 replies] Last: My second code is the correct program. Its output is 6857. I guess I'... (by zeitgaver)
|
by epi975
Strange char duplication
|
Hello! I am currently having a strange issue where the '@' char is duplicated when being sent to cout. Heres the code: #include <iostream> #include <win... |
Jun 5, 2013 at 8:49pm
[3 replies] Last: Wow thanks! It worked! It's amazing how such little things can have su... (by epi975)
|
by dredwerx
Baseball Stats program compiles with errors
|
Hello all, I am a noob in the process of learning C++ and so far things are going good. However I wrote a pretty simple Baseball statistics program from out of ... |
Jun 5, 2013 at 8:08pm
[9 replies] Last: Okay well, I probably just need to finish reading this chapter I am in... (by dredwerx)
|
by musipc
Random generator
|
Hy I have a problem with my school project. I need a program to generate random numbers, in predefined colums and rows. The problem is that the program only gen... |
Jun 5, 2013 at 7:54pm
[1 reply] : Try solving it using two-dimensional arrays. It will be easier(or at l... (by MatthewRock)
|
by GoranGaming
Euler Project Problem #3 (1,2)
|
Hello! I've been trying to solve problem number 3 of the "Euler Project", which basically is to find the largest prime factor of 600851475143, but my code does ... |
Jun 5, 2013 at 7:49pm
[23 replies] Last: but my program still has major flaws. if for example the user inputs... (by MatthewRock)
|
by ejuneau
invalid types 'char[int]' for array subscript
|
Hello all, So I was continuing my little text based adventure game, and I ran into a pinch. The code has gotten too big to post here, so here's the link to ... |
Jun 5, 2013 at 5:43pm
[5 replies] Last: Firstly this comparison is incorrect from the logical point of view. I... (by vlad from moscow)
|
by Zoo
Vector input
|
Hi! I would like to input 10 numbers to my vector. I am having a bit of tough luck though. Would someone direct me into the right direction? My code: in... |
Jun 5, 2013 at 5:33pm
[4 replies] Last: >>L B Got it thanks! (by Zoo)
|
Is one variable in nested loop alright? |
for(unsigned short int i = 1; i <= 10; i++) { for(unsigned short int i = 1; i <= 10; i++) { cout << 0; } cout << endl; } Fir... |
Jun 5, 2013 at 5:19pm
[2 replies] Last: According to the C++ Standard A name introduced by a declaration in ... (by vlad from moscow)
|
by xenodude2
Using "cout" in an "int" function
|
Quick Intro: The problem will probably be obvious, but I just started programming a week ago. I'm exploring different uses for functions, and wanted to create o... |
Jun 5, 2013 at 5:10pm
[3 replies] Last: Personally, your example works too, but if you plan on NOT cout'ing th... (by S G H)
|
by mahta
Invalid Allocation Size
|
I get the error- Invalid Allocation Size - for this part of my code: int var; float *res; cin>>var; res=new float[var+1]; Why is it like that and... |
Jun 5, 2013 at 5:03pm
[6 replies] Last: Thank you very much! (by mahta)
|
Why not make all functions inline? |
....... if a function calls make the statements of the program jump and that jump makes the program slower compare to straight execution of statements from top ... |
Jun 5, 2013 at 4:42pm
[3 replies] Last: Thanks :D (by jasonrobertz357)
|
by DrZoidberg
Getting input without cin ?
|
Is there a similar command that does not pause for the user to enter information? For example if I wanted to break a loop when a user presses the 'x' key, how w... |
Jun 5, 2013 at 4:38pm
[4 replies] Last: Thank you coder777 and Andy, solved my problem! (by DrZoidberg)
|
by Mushymon
Mushymon
|
Right now I have two completed projects, and the first one works perfectly, but is there a way to justify why a string with value 0 converted to an array become... |
Jun 5, 2013 at 4:24pm
[14 replies] Last: Here is the C# equivalent program for the C++ code above shown by me. ... (by vlad from moscow)
|
by hello1111
C++ string problem
|
Why I cant enter any input into the train.place1.from structure? when i compile no error occur. struct date { int day; int month; int year; }; ... |
Jun 5, 2013 at 4:00pm
[1 reply] : Line 36 leaves a newline in the input buffer, so your getline() reads ... (by Zhuge)
|
Variable increment issue |
Ok, weird issue here. I have the following variables set in this exact order: b8 cnrIsModeGood = false; u32 cnrGoodModel = 0; u32 cnrBadModel = 0; u32 cnrMax... |
Jun 5, 2013 at 3:21pm
[9 replies] Last: Earlier you showed the typedef typedef unsigned int u32; but in yo... (by shacktar)
|
by GoranGaming
auto Keyword
|
Hello! I'm just going to ask you guys a simple question, I was reading about the "auto" keyword, but when I tried it out it did not seem to work, and I don't re... |
Jun 5, 2013 at 3:09pm
[2 replies] Last: It works now! Thanks a lot :) (by GoranGaming)
|