Beginners - December 2015 (Page 13)

Iterator problem
 
Hi, I am trying to make a simple text based game. Within this game I have enemies in a List and a player. Within the code I am trying to implement where ...
[3 replies] Last: Fixed it thanks alot! (by PapaSmurf)
Sample code with errors for practising debugging skills?
 
Hello everyone, I teach C++ programming, and I noticed that many of my students have really bad debugging skills. Even though I've already taught them how to...
[no replies]
Need helps with streams
 
Write your question here. I was asked to declare and define a function the uses an output stream parameters. The function read a line of input from a file na...
[1 reply] : http://www.cplusplus.com/doc/tutorial/files/ (by JayhawkZombie)
Variables initialized in a class become deinitialized?
 
I have a class named TimeCard that passes a time and logs it to either punchIn or punchOut. line 58 is able to pass the time variables from TimeCard and set it ...
[2 replies] Last: Lines 28-33: Appears to be a code fragment from someplace else. Thes... (by AbstractionAnon)
by sep11
writing array from external file
 
Hello! I'm trying to write a 2d array from data in an external file. I was trying to use a function to get it load line by line, but it didn't work, becuase...
[no replies]
by Zorac
Need help how to make a remove_if function to "remove_if_not"
 
So after trying to solve a problem for several hours i am very close. I need to remove all characters that is not alphabetical but currently i am removing all a...
[13 replies] Last: Thanks for the help everyone. I needed a few hours rest in order to un... (by Zorac)
fatal error: #include "WPILib.h"
 
wrote just a template out for a robot we're programming at school. I pressed build on code blocks and got the error "WPILib.h" I moved the program to eclipse to...
[5 replies] Last: finally found my problem. Whenever I was supposed to start a program I... (by eloy1073)
populate array with random numbers
 
I'm trying to populate an array with random numbers ranging from 1-200 (repeats acceptable) but I don't know how to do this. I also want to sort them and output...
[5 replies] Last: Thanks booradley60 this helped a lot. I think I've just been staring a... (by clueless007)
CS term confusion
 
does anyone have a clear cut difference between a dangling pointer and a lost object? i know one of these or both cause a memory leak also i know binding li...
[11 replies] Last: int * ptr1 = new int; // Allocate from heap ptr1 = new int; ... (by AbstractionAnon)
How do I get the enemy to follow me?
 
Hello! I'm having so much trouble understanding how to create this code... Recently I found out how to make the enemies move randomly on the screen, but...
[6 replies] Last: I'm trying to learn classes on my own, but it's due tomorrow now :/ I ... (by goflipaburger)
c++ Calling class method from another class (unresolved external symbol error)
 
I have a class called TimeCard, which under its constructor, calls a method defined in a friended class (Time2). But when I compile it, I get this error: erro...
[1 reply] : Line 42: getHours() does not appear to exist in your TimeCard class. ... (by AbstractionAnon)
by Cat32
Fraction Class
 
Hi, so I had to make a Fraction class for a programming class. It was supposed to convert the fractions to a decimal, reduce them, and use the overloaded ==, <,...
[9 replies] Last: Thank you everyone! (by Cat32)
Hero's Inventory
 
*Its only a portion of the code due to the character limit* I need to add these following variables but have no idea how to:  input the theme of their “fav...
[3 replies] Last: But what variables do I have to use? Do I have to add more strings or ... (by mark1659)
structs are frustrating (1,2)
 
Hello! I am having a hard time with structs. I don't understand how to access a struct in a while loop. Can you advise on this? #include <iostream> #inc...
[23 replies] Last: I was going to try using cin.ignore but I'm not sure if that would wor... (by underoathed)
purpose of Binding?
 
Static binding runs in compile time and Dynamic Binding runs in run-time..what is their purpose? Any other information would be helpful
[no replies]
buffer and file relationship?
 
input/output buffers how do they relate to file open & close methods with files? The information I have found, not sure how it helps me answer my questions a...
[5 replies] Last: Thanks that helped allot (by nameishi)
Loding list from text file, adding new data to it erases the list and creates a new
 
I have a list of accounts (konton) where i save the values in a text file and use in a vector. And have to add a new customer to the existing/loaded list with t...
[3 replies] Last: ofstream outFile; outFile.open("Bank.txt"); outFile.ope... (by cire)
by dfr4
I have a problem with strings
 
So i have to write a program that reads two strings and prints out yes, if the second one is a substring of the first, and no if it's not. I would really apprec...
[4 replies] Last: i don't know. Maybe i haven't compile it correctly the last time. I tr... (by dfr4)
Random function
 
I have a problem to understand how random function work in c++ how we can calculate the output of random function void main() { randomize(); int NUM; NUM...
[3 replies] Last: Both random() and randomize() are Borland-style functions, though they... (by Chervil)
Printing, opening/closing files, and arrays
 
Hello. I am having trouble with this code. Would not give me an output and I don't understand why I have some errors. Here is the scenario: FIRST: Declare al...
[5 replies] Last: How is the format of the files? (by Thomas1965)
December 2015 Pages: 1... 1112131415... 43
  Archived months: [nov2015] [jan2016]

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