Beginners - February 2012 (Page 46)

by moot1
functions
 
Im trying to learn multiple functions and trying to put a class in a program. Cans you please tell me what bit of code to make into a function to call into main...
[9 replies] Last: Oh, I was confused. double Func1(); //Function which returns a double ... (by LB)
Reading file into Vector and printing
 
I am getting a few errors, but one that I think might fix most of them is being able to fix the error that says "StudentProfile' was not declared in this scope"...
[2 replies] Last: Like @sea noob said, you should put your classes in header files. But... (by histrungalot)
Class within a Class / Class variable
 
Hey guys, I'm just learning about classes and I tried to make a class within a class. It didn't work and I've tried awhile but I cannot find the problem and I'm...
[2 replies] Last: Thanks, Hist that got rid of some of the errors I think I may can figu... (by iiiusion)
Implementing score counter in game.
 
Right now i have "int score" all over the place in the main() function and the subroutine functions, from trying to make the point system work if the user got t...
[4 replies] Last: This should cover everything I think: #include <iostream> u... (by WhiteWind)
Loop
 
Hey all, I'm new here, but I'm in college for C++ programming, unfortunately I'm only in my first C++ class and we haven't went over the loop statement yet. B...
[5 replies] Last: @eyesofhope: You can use break; and continue; : #include <ios... (by WhiteWind)
Where To Start?
 
So I needed a couple of classes as fillers and the school placed me in C++. I came in at a rather odd time because they are starting their forth major project. ...
[1 reply] : I always start problems by writing out pseudocode to help me with the ... (by knightwriter)
by moot1
rpg
 
why in this program when i press 1 which should subtract 15 from comphealth it doesnt i put cout << comphealth and it still says 250 after i press 1? #inclu...
[10 replies] Last: Sorry for the wait, it took me a while to type this up for you. I went... (by WhiteWind)
by Cninja
Can you review my code for a simple linked list?
 
I been practicing programming with c++ as my first language and the topic i am on is on : data structures one of them being linked list. concerns: * I am w...
[2 replies] Last: Oh yes line 44...i forgot to remove that before submitting it looked ... (by Cninja)
# define vs constants
 
I had to do this program for a test, when i was using pound include define i was getting this error, so instead i used constants. But i...
[2 replies] Last: Your problems are here - you can only use the modulus operator % on ... (by Moschops)
error: no match for 'operator<<'
 
This is my code Project.h #ifndef PROJECT_H #define PROJECT_H #include <iostream> #include <string> #include "staff.h" class Division; clas...
[9 replies] Last: Okay, thats helpful. Thank you. Now, I think I'm headed in the correct... (by VladTeppi)
C programming
 
hello. I have installed dosbox and turboc both according to the standard procedure. I tried running a simple hello world program but it says that unable to ...
[1 reply] : Use PellesC instead. http://www.smorgasbordet.com/pellesc/ (by Moschops)
Getting a calcluated value into an array index using a pointer ... ?
 
Hi I'm working through a finance book which is doing something rather simple, which I could probably do in excel but wanted to try in C++. Being not overly ...
[no replies]
Program in via book by McGrath returns compilation error
 
The code for the first program in the book C++ Programming in Easy Steps by McGrath is as follows: #include <iostream> using namespace std ; // A C++ p...
[1 reply] : #include <iostream> using namespace std ; // A C++ program to ou... (by helpMePlze)
pointer example
 
hello when i was reading the documentation i found an example but i didn't quite understand it. down here ill send the example with comments on how i think i sh...
[1 reply] : Changed some comments and removed the comments you understood. void ... (by clanmjc)
Can I make operator+ a const function?
 
I am working through some examples in *Sam's Teach Yourself C++ in 21 Days (5th Ed)* and I'm trying to fully understand the use of `const` methods. My question ...
[8 replies] Last: And to throw a wrench into the works the book also states that a `con... (by clanmjc)
by moot1
string help
 
im trying to make a rpg game and im using stings so the user can enter his/her name...but when the user enters her name all it prints back is numbers when its s...
[3 replies] Last: out of bounds Good catch I didn't look past the declaration once I s... (by clanmjc)
Retaining data after restarting program?
 
Hi, I'm writing a program to calculate cash transactions. I'm supposed to allow the user to restart the program to enter a new transaction an unlimited numbe...
[6 replies] Last: See what I typed above, notice... float min, max, average; are outsi... (by clanmjc)
Uses for Pointers (1,2,3)
 
What exactly is the point of pointers. From what I've seen all you can with them is: *x=&y which is the same as x=y What else can they do?...
[56 replies] Last: Are we to take it also that you have never needed to create a large o... (by BrokenSilenceDev)
by Britny
Read Integer Data From a File
 
I'm taking a beginner level C++ class, and have gotten stuck on one of the practice problems. The assignment is to read in a file with a random set of intege...
[1 reply] : Here are 2 different ways of writing and storing integer values to and... (by Texan40)
prime composite or neither.
 
Hey, trying to create a program that allows the user to enter a number that is then defined by the program as prime, composite, or neither. For some reason it ...
[1 reply] : prime and composite , you set them but you never use them. Because... (by clanmjc)
February 2012 Pages: 1... 4445464748... 64
  Archived months: [jan2012] [mar2012]

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