Beginners - March 2011 (Page 2)

by larix
(solved)fstream - name with space
 
Hello I'm trying to write simple program that reads stuff from files and write it to other file, there is no problem here. However when i try to open file ...
[4 replies] Last: Indeed when I doubled slashes AND removed " from begging and ending of... (by larix)
help with the InputAndValidate Function
 
Would you kindly review the code. I've finished the coding, I'm struggling with one function. This is the question I got regarding the function. Function in...
[no replies]
Tell the error plzz
 
i m unble to use protected variables in inherited class so please help me code is:: #include<iostream> using namespace std; class Book { protecte...
[5 replies] Last: I ran a check and webJose is correct. A class can only access its own ... (by Mathhead200)
Finding Maximum and minimum values in a set of integers?
 
I have an assignment where I have to write a program that accepts a series of integers from the keyboard from 1 to 100 using a single sentinel controlled loop, ...
[13 replies] Last: I don't give answers to people who don't try. Look at Lkafilta's post ... (by Mathhead200)
weighted probability model?
 
I'm trying to figure out how to best work a weighted probability model into code - I'm trying to implement a random selection where each element has their own s...
[4 replies] Last: Alright, thanks. (by pabloist)
by kris84
Please help me fix this syntax C++ error
 
Deleted.
[5 replies] Last: its tolower //not lower um in your header try adding #include <ccty... (by SFX9901)
How to...Please???!!
 
how to open a .txt file????? Am i doing anything wrong on this function????? int openFiles(ifstream& inFile, ofstream& outFile) { inFile.open("exam...
[15 replies] Last: i got it (by detroit)
void FUNCTIONS WITH ONE OR MORE VALUE PARAMETERS
 
I was given a series of question that will lead to a final aswer. Suppose we want to display the following pattern on the screen: ssssOOOOssssOOOO ssssOOOO...
[3 replies] Last: Thanx. Its fixed. You didn't mention what you fixed! Please can yo... (by Jasonb)
by w1llux
Input file
 
Okay so i've recently wrote a program calculating a utility bill. inputting the account number, name, type and usage..for example { validAccountNumb...
[4 replies] Last: #include <iostream> #include <iomanip> #include <cmath> #include <... (by w1llux)
Files aren't saving and loading correctly?
 
So in the program that I've been asking quite a bit about on this forum for help with, I have it so that the user can save and load their game. Usually, the gam...
[10 replies] Last: Ah! I got it! Thanks so much! (by theholyfork)
about setting precision
 
// setprecision example #include <iostream> #include <iomanip> using namespace std; int main () { double f =3.14159; cout << setprecision (5) << f ...
[2 replies] Last: If you read that part of the tutorial more carefully, you'll find the ... (by m4ster r0shi)
Command line warning?
 
Lately I've been flipping through graphics programming books trying to get a feel for it but I've been stopped short by either my compiler or some other factor....
[no replies]
Enter name using Class
 
#include<iostream> #include<cstring> using namespace std; class player { private: char firstname ; public: void setfname (char name ) { strcpy (firstname, nam...
[4 replies] Last: I cna't, becuase i am not fimliar with it and it si required i NEED to... (by hunkeelin)
by Vuurk
Using other forms of user input besides int
 
How do I get input from the user besides just integers? I'm trying to make a simple calculator program and I want to let the user decide which operator to use ...
[11 replies] Last: well my old source code directory is to scary to dig through sorry :( ... (by bboy212)
need help to my program
 
below my program and i just want to add function that find highest grade can anyone help me #include <iostream> #include <cmath> using namespace std; #d...
[1 reply] : We're not going to do it for you... start here (pseudo-code): float... (by packetpirate)
casting struct with pointer to const
 
I have a struct containing a pointer, and I want to pass it to a function such that the function can't modify the contents of the pointer. For example, stru...
[4 replies] Last: Disclaimer: not tested. :) class T { int n_; public: int g... (by moorecm)
Undefined reference
 
Hello, I know the code is correct but for some reason when I compile the code it says "[Linker error] undefined reference to 'myFun::add(int,int)'" . I am comp...
[3 replies] Last: This will be the easiest for you to learn if you've already started wi... (by Computergeek01)
Errors
 
ok so I have this assignment for class, and im trying to run it, but everytime i try to compile it, it tells me that it "cannot convert 'std::string' to 'std::s...
[6 replies] Last: wow, thank you. lol i woulda been stuck all night (by adoubek)
by Snhr
Overloading Operators and Class Inheritance
 
I was wondering how I would do this, I have a class called Shape2D with overloaded + and - operators and then I have 2 inherited classes called Circle and Recta...
[2 replies] Last: I think you may need to do it this way: class Rectangle: public Sha... (by sadavied)
by scibat
#include "stdafx.h"
 
Hello all! I am learning C++ and using MS Visual Studio 2010 as my IDE. I am following the tutorials at LearnCPP.com and on the first tutorial I hit a snag....
[3 replies] Last: You only need it when MSVS gives it to you. If you make a blank pro... (by Disch)
March 2011 Pages: 1234... 52
  Archived months: [feb2011] [apr2011]

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