Beginners - October 2010 (Page 31)

Error:expression must be a modifiable Ivalue
 
Hello i'm new to c++ and i'm following the xoax.net c++ tutorials and now i'm trying to complete the tic tac toe game. But i get this error : Error:expression ...
[4 replies] Last: Thanks i used == and it works now thanks :D (by piggekott)
Integer problem
 
I need a program to be able to take in an integer 4 digits long, made up of only 1 and 0. However, integers will ignore the 0 if it is in the front, for example...
[4 replies] Last: This is probably not what your after... #include <iostream> #i... (by AlphaBravo)
Parenthesis in Declaration Question
 
Hello, I was just wondering what specifically the () does in the first and second line after the "public:" declaration? When I make a point object without any ...
[3 replies] Last: Almost, but not the same. Suppose a constant attribute or one that ha... (by ne555)
Using typedef?
 
I'm thinking of using typedef so that I can simplify (*iter_)->sprite.Move((*iter_)->speed,0) . I tried doing: std::vector<Laser*>::iterator iter...
[8 replies] Last: Oh..that makes a lot of sense. Now that I look at my code, I'm wonderi... (by pabloist)
by mp9191
Problem with cin.peek()
 
Hello, I am writing a program which requires me to read in input and build a binary tree from it. The input is in the form: empty tree::= () tree::= empty...
[4 replies] Last: If you know that you are reading a number, why don't you read it as a ... (by ne555)
Time of day from decimal number
 
I am trying to output the time of day from the decimal part of the Julian day number but I can't get the calculations right. now.jdn() produces the current Jull...
[2 replies] Last: Thanks ,that worked perfectly. (by LostCoder)
Simple multidimensional array problem
 
Hi, I'm new to C++ and have just started using multidimensional arrays. I created a program (following a book) that creates a multidimensional array to lookup a...
[2 replies] Last: Thanks for your reply. I understand the problem now. I initially thoug... (by MugenTenshin)
by Maerle
What's the meanig of ?
 
what's the meanig of: primeirocarro = (struct carro*) new (struct carro); if (primeirocarro == NULL) exit (1); ? what is NULL and th...
[2 replies] Last: [quote=Maerle]what is NULL and the function exit();? They are prog... (by PanGalactic)
Why won't this compile
 
void functionadd(){ int size = 50; int iarray ; int number; int total; for(int i=0; i<size; i++){ ...
[4 replies] Last: I spent atleast a half and hour re reading this over and over again. B... (by Analyzer)
by mp9191
Determining the data type while reading in ints and chars from file
 
Hello, I have a program which requires me to read in a tree from a file that comes in this form: empty tree::= () tree::= empty tree | (integer tree tree...
[2 replies] Last: Thank You! (by mp9191)
Virtual functions and templates
 
So I'm having another problem, this time with virtual functions and templates. I have this base class header file, truncated for only the essential details: ...
[6 replies] Last: [quote=Erdrigard]I do usually split up classes into separate h and cpp... (by guestgulkan)
by Maerle
what's wrong with the program? (decimal conversion)
 
I think all the problem is on the menu and on the base identification. // Program to convert a decimal number in binary, octal or hexadecimal one. #inclu...
[2 replies] Last: yees you are so sure i did this now cout << "Programa para c... (by Maerle)
I cant rectify errors in this c++ program made by my friend
 
/* FUNCTION TO GET THE CURRENT SYSTEM DATE */ void DATE :: CURRENT_DATE(void) { struct DATE date:d; getdate(&d)}; day = d.da_day ; ...
[2 replies] Last: What are you expecting this line to do? struct DATE date:d; ... (by Galik)
ifstream as global variable
 
I'm having trouble making this global and I can't figure out what Im' doing wrong. It was actually just a test SSCCI and still comming up with errors. Error: a...
[2 replies] Last: it's going to be one of those days :( thanks. edit: now I've go... (by gcampton)
Loop Problems
 
Hey all. I got an assignment today : 2) ch4ex8.cpp Write a C++ program that sums the integers from 1 to 50 (so that is, 1+2+3+4+...+49+50) and displays the r...
[4 replies] Last: *Slaps head* Doh! I guess I was making it too hard on my self. Thanks ... (by strychnine213)
how to check if a FILE is open
 
I've got a FILE pointer like this: FILE* file; How can I check if it's open? Is it possible to use ofstream::is_open method?
[1 reply] : if you call fopen, you can check for NULL FILE* is for C file I/O ... (by Bazzy)
do while looping problem
 
i having a problem with my code, i don't yet know how to use the do while, but i want to do this with do while.. this program will compute grades.. 1st loop, it...
[6 replies] Last: int main{ int loop = 0;//set before looping char option;//yay... (by hamsterman)
Random "rand()" and srand(time(NULL))
 
Hi guys; sorta got a question and a comment, but more of a question: So first of all this is my source code(Heads up, it was written for opening the cd drive...
[4 replies] Last: You can replace time(NULL) with any interger eg: srand(1234); ( i... (by Bazzy)
transaction history
 
I have this programming project for our finals... I am making an ATM account that contains deposit, withdraw, balance, and transaction history. My program ran.....
[1 reply] : See the fstream reference on this site. (by Athar)
by areid
Converting a double into a String
 
I am creating a program where the user inputs a value and it calculates the log10 value of the input. But I need to make it so that if they input a negative val...
[1 reply] : Um... if (value<0)cout << "undefined" << endl; else cout << log10... (by Athar)
October 2010 Pages: 1... 2930313233... 42
  Archived months: [sep2010] [nov2010]

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