Beginners - June 2015 (Page 16)

Reading a node tree
 
I'm working on a basic parser and I want to be able to read through the node tree generated by the parser. Right now, I'm attempting to use a recursion-method ...
[no replies]
Recursion Question
 
I am completely lost on how to write this code in recursion. I'm supposed to write it three ways. 1. In a function that simply has a formula. 2. In a loop. ...
[3 replies] Last: If you can manage a function that counts down (or up), you're pretty ... (by andywestken)
Loop Error
 
Write your question here. The important part of the code is the loop all the way at the end. #include <iostream> #include <cmath> #include <cstdlib> #inclu...
[5 replies] Last: If amount of iteration is known beforehand, use for loop: for(int i =... (by MiiNiPaa)
Allowing users to select a symbol?
 
I'm pretty new to C++, and for a summer course we have to use a function to print a diamond, but we also need to let the user input a character to be used to cr...
[1 reply] : Line 4: What are you trying to do here? You are overwriting value whic... (by MiiNiPaa)
by Beju
Cast pointer to int
 
Hello! My question is pretty is pretty much like in the topic. I have a typedef like this: typedef ptr * some_t; I want to assign int to it (and vi...
[10 replies] Last: I probably don't understand what Beju is trying to do, and I know this... (by Ganado)
Creating function eqQuadSides
 
Hi all, I have to create a function that will return how many sides of a quadrilateral are equal. Here is what I've come up with: bool eqQuadSides(int ...
[1 reply] : Several problems. 1) You can't declare int eqSides = 0 in your functi... (by AbstractionAnon)
taking information out of a for loop
 
Hello. I am trying to write a code that will assign a number to a "box" in a 10x10 grid. If it has assigned a 1 I want it to save that and skip over it next tim...
[3 replies] Last: Ok. Why all the elements are not set to 1 immediately? There must be s... (by keskiverto)
by Optx
HELP PLEASE
 
MY CODE DOES NOT WORK, AND I REALLY DONT KNOW WHY! I TRIED TO FIGURE OUT EVEN WITH PEN AND PAPER, BUT EVERYTHING SEEMS PERFECT EXCEPT OUTPUT. I WANTED TO MAKE ...
[15 replies] Last: Here's a small example which shows how to overload operator++ in order... (by NoXzema)
Upper case convertion C++ problem solving issue
 
Well the question is pretty basic... it's- You are given T names in english letters. Each name will include some of the uppercase letters from A to Z, some o...
[4 replies] Last: YEahhhhhhh,,,,hurrahhh!yippppi............thank u man.....it works lik... (by soccer71)
by nash
read text file into array
 
I'm fairly new to c++, and I've just finished writing this function but it won't work. I'm trying to copy the text file records into an array then display the r...
[3 replies] Last: The user should enter an employee ID, the function then should search ... (by nash)
I struggle with two problems.
 
I keep struggling with two lines. It keeps saying like this the left brace '{' was unmatched at the end of the file (line 8) IntelliSense: expected 'while' (...
[13 replies] Last: And I put count ++; too. It should show me counts when username is w... (by DCisthebest)
Array Pointer Error
 
I am building a small program for fun currently. The first part of the program builds an array off of user size input and then randomly generates numbers to fil...
[3 replies] Last: As I said: use array . And notice this line: array = temp; Aside ... (by MiiNiPaa)
by nkj15
username and password
 
hey! im doing a project using c++ programme. i need help on how to create a username and password in microsoft visual studio 2010. please help me!
[8 replies] Last: be carefull with buffer overrun #include <iostream> #include <cstring>... (by ne555)
by wrymn
Help me prevent object slicing in this code.
 
I have a base class GameObject. This class has this function. GameObject* GameObject::Instantiate(GameObject* object, Vector2 position) { //Construct ...
[7 replies] Last: https://katyscode.wordpress.com/2013/08/22/c-polymorphic-cloning-and-t... (by ne555)
differance between float and doble
 
#include<iostream> #include<conio.h> using namespace std; void main() { float a=0.15; double b=0.15; if(a==b) cout<<"equals"; else cout...
[4 replies] Last: To better understand how that can limit precision, try to write 1/3 or... (by MiiNiPaa)
Read von File!!
 
Hi, I have Problem with reading a number from file. I have a number 0.8147236863931789 my program read as 0.814724. my code : std::ifstream fin("test2.txt...
[1 reply] : Use the precision member function (or std::setprecision) before prin... (by Peter87)
by laenos
pointer to function
 
How can access to a variable defined in a function which is part of a derived class from a base class? Is the follow code ok? CClassBase{ public: void Funct...
[4 replies] Last: Thanks (by laenos)
Tower of Hanoi
 
I am trying to solve the Tower of Hanoi problem. I broke the problem into two parts. The movement of a particular disk and then that particular disks's movement...
[3 replies] Last: @Blackhart98 I apologize for anything that I posted that doesn't comp... (by jhykima)
by RokSav
Primal number algorithm: works for small numbers (<100000 or so) and then fails
 
I made a code to determine whether a number is prime or not. I doubt it's optimized, but that's not what's interesting. Thing is, this code works for numbers up...
[3 replies] Last: Yes, 10 10 is overflow for int . Since negative numbers cannot be p... (by Duthomhas)
pointer to array of integers
 
I was looking for pointer to an array of integers. I know that int * means pointer to integer type. On same lines, I thought int * means pointer to array o...
[4 replies] Last: Wow @andywestken, thanks for that explanation. You added lot more clar... (by funprogrammer)
June 2015 Pages: 1... 1415161718... 32
  Archived months: [may2015] [jul2015]

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