Beginners - October 2016 (Page 38)

Inserting a node into the head of a linked list
 
For some reason when this code runs it will only run the code in the else statement. I know for certain that head is set to NULL. I am very confused on why this...
[no replies]
Random Shuffle and Vector Elements
 
hello, I am a beginner in C++. I am trying to make a code that involves a string vector randomly selecting 1 to 3 elements from another string vector and then ...
[no replies]
by jeg19
creating a file & sending info to it
 
Write a program that reads from the keyboard, the number of point scored by the football team in each game. In the meantime, it also writes the entered scores i...
[2 replies] Last: ok so this is what i have so far, im not sure how to total up the poin... (by jeg19)
My Remove() node function does not work
 
I'm trying to remove one node from a linked list. I'm able to locate the node but the remove function does not work, it keeps returning false. Please take a loo...
[no replies]
Sfml Vectors errors
 
I am making my first graphical game, and I found that there was an error in one of my functions, upon using a Vector2i named MouseCoords, I used it in a functio...
[2 replies] Last: Thank you! (by Optimistic Peach)
by jeg19
while loop isn't working
 
Write a program that has the user enter a number greater than 1 (Also validate the input using a loop). Proceed with the valid input as follows: If the number ...
[2 replies] Last: ne555 is correct. The semicolon denotes the end of a statement for th... (by Hirokachi)
Order of execution for lambda snippet not understood...
 
I found the following code and output in the textbook: "The C++ standard library". Why is the assignment to 42 not carried out until after the lambda is exe...
[1 reply] : See https://msdn.microsoft.com/en-us/library/dd293608.aspx The id use... (by keskiverto)
Beginner needs a little help with isVowel value returning function program.
 
I've been banging my head against the wall for days now, trying to get this function to return a value. I think I'm too close, but I suspect that my isVowel fun...
[2 replies] Last: Thank you, thank you, thank you. I used this and put on some finishing... (by TuxedoJack)
[SOLVED] new to c++, two errors while compiling headers
 
Hi, i am new to c++, i am using code::blocks. I was using Lazarus for object-pascal programming with a good knowledge but now i decided to learn c++, adding a ...
[6 replies] Last: I just saw this post a bit before you answered me.. it now works! Than... (by Manuel Di Criscito)
Populating an Array
 
Hey everyone, I need help in populating my Days array. I have an assignment that requires me to write a program that generate random months and days. I can gen...
[5 replies] Last: Still working on this, I believe I'm getting closer to solving this I ... (by TheCowstah)
Question with operators
 
Very easy question (I believe) that I do not know the answer Why this "n = n*3 +1" is not equal to this "n *= 3 +1"? If n= 3 First method: 3*3 + 1 = 10 Secon...
[1 reply] : Basically you can't. But you can make the first equation evaluate the ... (by jlb)
Can't get rid of the errors
 
Getting a couple errors with my program. |23|error: no match for 'operator=' in '((MyStack<char>*)this)->MyStack<char>::list = (operator new(12u), (<statement>...
[4 replies] Last: I changed line 23 to list = *(new MyLinkedList<T>()); The code wi... (by AndyGator)
Sqrt in array?
 
Hello, I got an question: If user enters 1-10 range of natural number ( only positive numbers ). I have to find sqrt of natural numbers that is in the range...
[5 replies] Last: Thanks, and im sorry that i made you confused :P Well gonna try to bu... (by Karalis)
How does this code obtain, binary, octal and hexadecimal numbers
 
I got codes that shows how to obtain binary, octal and hexadecimal numbers. However, i could not understand so i need some guidance. This is the binary repre...
[2 replies] Last: I do understand there's some other easier way of doing such operation.... (by amoureux)
by SKREFI
I have a code problem.
 
Why do I get 2nd and 4th output ? It is broken, it should only output 4th output! (It is a small part from a game I want to make! (I am bigginer) and this is ...
[2 replies] Last: Haha, thx man! (by SKREFI)
How to insert if into a void function?
 
Hello guys!! I'm at the point where i need to insert an 'if' statement to my exercise! The code works until i reach the point with the if statements This is ...
[5 replies] Last: Your function addNumbers says it returns an int. But it doesn't. It d... (by Moschops)
Quadratic equation with functions (and arrays, maybe)
 
Suppose we have a quadratic equation, ax^2 + bx + c = 0 (a, b and c are integers). The discriminant for the said equation is D = b*b - 4ac, - If D = 0 --> one ...
[9 replies] Last: I have fixed it now, it's a bit longer and "uglier" so to speak howeve... (by Pedro0x)
x^x=2016 (bisection)
 
Can someone tell me where the error is? When I run it, I see just a blinking underscore. Sorry if the mistake is obvious! Thank you :-) #include <io...
[4 replies] Last: Thank you! You're right about the compiler. I felt like this might b... (by beginner321)
Reverse words in string with space not working.
 
Write your question here. #include <iostream> using namespace std; int main() { string name; string reverse; cout<< "Type strin...
[6 replies] Last: Here is another solution, I reverse the entire string to start with, t... (by closed account LA48b7Xj)
Car Rental Program Help
 
So my lecturer gave me this assignment: 1. You are employed to develop a program for a car rental company, The program should keep track of how much money you...
[17 replies] Last: welcome :) (by shadder)
October 2016 Pages: 1... 3637383940... 51
  Archived months: [sep2016] [nov2016]

This is an archived page. To post a new message, go to the current page.