Forum: C++ Aug 15th, 2008 |
| Replies: 3 Views: 511 The function declaration should be identical to the function definition exept that you do not need to put a semi colon after the function definition. Another easier way to do it is to put the main at... |
Forum: C++ Jul 29th, 2008 |
| Replies: 3 Views: 438 First of all use code tags. Second do not use void main..main has to always return something. Then, what is the program supposed to do and what dont you understand about scanf..what kind of errors... |
Forum: C++ Jul 29th, 2008 |
| Replies: 5 Views: 593 It looks like you have declared an array of 25 rows and 10 columns. I'd suggest you intialize the rows to their value(rows=25) and columns (cols=10). Try my example
for (i=0; i<=rows; i++)
... |
Forum: C Jul 24th, 2008 |
| Replies: 15 Views: 1,408 There could be a possibility that if "GetInteger" is a function it is not of integer type. Otherwise if "GetInteger" is not a function then it is not declared :) |
Forum: C++ Jul 7th, 2008 |
| Replies: 13 Views: 1,036 What kind of problem are u experiencing with setw()? Did you add the header file "iomanip"? |
Forum: C++ Jun 27th, 2008 |
| Replies: 9 Views: 641 I think your getting no output because you are overwriting the data in the array names[]. You want to assign the values of name[] to namesMore[]. Change your assignment statement to something like... |
Forum: C++ Jun 27th, 2008 |
| Replies: 9 Views: 641 If you want to assign the values of one array to another maybe you can do something like this
for(int i=0;i<max;i++)
{
array2[i]=array1[i];
} |
Forum: C++ Jun 22nd, 2008 |
| Replies: 10 Views: 851 You may need to change the while loop to a do-while loop. To keep count of your plays, you need to add a counter wherever you need an increment i.e whenever the user plays the rock you do something... |
Forum: C++ Jun 21st, 2008 |
| Replies: 3 Views: 1,883 Yes. you can read more about it here http://www.cplusplus.com/reference/clibrary/cstdio/getc.html |
Forum: C++ Jun 20th, 2008 |
| Replies: 5 Views: 787 You can still check the empty project option but under the project you add a new source file to the project |
Forum: C++ Jun 18th, 2008 |
| Replies: 6 Views: 1,029 AcientDragons's code seems to be working fine. You need to include the header files "string" and "sstream" to . You need to change a little bit of the code by just adding this std::stringstream... |
Forum: C++ Jun 17th, 2008 |
| Replies: 5 Views: 761 You have initialized b to 10 and your do while loop will keep going until 0 is reached. I would suggest you prompt the user to continue then you code the loop like this
do
{
//code here
... |
Forum: C++ Jun 10th, 2008 |
| Replies: 13 Views: 934 well the fact that someone can copy a code from somewhere, call it his, then someone else gets the same code from the original cheat...and so on..it is frustrating and really disapointing but the... |
Forum: C++ Jun 10th, 2008 |
| Replies: 13 Views: 934 All the time I open this thread it just puts a smile on my face..but I have just laughed my ass off after some of the previous posts :) |
Forum: C++ Jun 8th, 2008 |
| Replies: 17 Views: 1,372 I used 4 since you implied that only 4 data will be needed..anyway you can declare a constant size for the array that can be changed. you can put this in your program. but remember it should be a... |
Forum: C++ Jun 8th, 2008 |
| Replies: 17 Views: 1,372 >>I'm really not sure how to do the arrays and please correct my mistakes..
Looks like you need a 2D array. do something like this
int array[row][col];
int i,j;
... |
Forum: C++ Jun 8th, 2008 |
| Replies: 17 Views: 1,372 you can insert another funcion or you can insert that after the withdrawal is made |
Forum: C++ Jun 8th, 2008 |
| Replies: 17 Views: 1,372 then you need something like this.you need to do this after the withdrawal has been made and not before
double interest=0;
interest=(0.05)*deposit; //or
interest=((5/100))*deposit;
... |
Forum: C++ Jun 8th, 2008 |
| Replies: 17 Views: 1,372 No. you can do something like this
employeeArray[]="the string";
or you initialize the elements of the array to 0..this has to be in integer type or double
employeeArray[]={0};
... |
Forum: C++ Jun 8th, 2008 |
| Replies: 17 Views: 1,372 for your second post, how would you expect to calculate the interest rate if you dont know how it is done i.e is it 5% of the balance per month, 5% of the balance after each withdrawal,etc..you need... |
Forum: C++ Jun 8th, 2008 |
| Replies: 17 Views: 1,372 well to implement your arrays you need a for loop and you need to initialize the arrays. I presume you want an array of names and one for the salary. Then you may need something lilke this
string... |
Forum: C++ Jun 8th, 2008 |
| Replies: 17 Views: 1,372 is your second post related to the first post? if not, why not finish up the first problem then move on to the next. if yes then its a little confusing and therefore you should state your problem... |
Forum: C++ May 25th, 2008 |
| Replies: 9 Views: 910 you already have a simple pseudo that is really straight forward
-propmpt user...
-accept input.
-if ....
do...(can be call function)
-else if ....
do....(can be call function) |
Forum: C++ May 17th, 2008 |
| Replies: 1 Views: 1,586 replace line 11 with this
cin.getline(text,20)
hope that helps |
Forum: C++ May 10th, 2008 |
| Replies: 11 Views: 1,041 have you tried replacing the "int" with "studentType" |
Forum: C++ May 10th, 2008 |
| Replies: 11 Views: 1,041 your not making max an array...your assigning the value in "person[0]" to max..the logic is supposed to be you assume the 0th element is the highest hence the
max=person[0];
did you try... |
Forum: C++ May 10th, 2008 |
| Replies: 11 Views: 1,041 you are outputing the array position by using max..change line 93 to something like this
int max = person[0];
you need to also change from line 95
for (int r = 1; r < numStudents; r++)
... |
Forum: C++ May 10th, 2008 |
| Replies: 11 Views: 1,041 please use code tags so as to make your code look readable...in you code i noticed a mistake that reads into a file u need this
inFile>> /*contents*/ |
Forum: C++ May 9th, 2008 |
| Replies: 19 Views: 1,392 if your header file is called header1.h then you can do this
#ifndef header1_H_INCLUDED
#define header1_H_INCLUDED
#include <iostream>
#include <iomanip>
#include <fstream>
#include... |
Forum: C++ May 9th, 2008 |
| Replies: 19 Views: 1,392 i dont know what the program is suposed to do but the output looks okay..can u try doing what i indicated in my last post |
Forum: C++ May 9th, 2008 |
| Replies: 19 Views: 1,392 i think you need to put header guards in your header file
#ifndef /*your header file name*/_H_INCLUDED
#define /*your header file name*/_H_INCLUDED
//what is contained in the header file
... |
Forum: C++ May 9th, 2008 |
| Replies: 19 Views: 1,392 look at the edit features where you create you post |
Forum: C++ May 9th, 2008 |
| Replies: 19 Views: 1,392 am finding it hard to read ur code..can u re post it using code tags |
Forum: C++ May 9th, 2008 |
| Replies: 19 Views: 1,392 your compiler settings may have been change to not recognize syntax errors or ignore warnings..so when you build your program it cannot go anywhere until the errors have been fixed....can you repost... |
Forum: C++ May 9th, 2008 |
| Replies: 19 Views: 1,392 you should change line 23
const double CHARGE = 10;
const double ATMFEE = 2;
your GetData function definition has got no variables referenced but you are calling it with variables..change... |
Forum: C++ May 9th, 2008 |
| Replies: 19 Views: 1,392 could you elaborate more on your problem |
Forum: C++ May 4th, 2008 |
| Replies: 7 Views: 633 so far i can see the following mistakes...when you are calling functions you dont put the whole function definition..
also you need to declare all the functions before defining them.
int... |
Forum: C++ Apr 27th, 2008 |
| Replies: 26 Views: 2,110 it looks like you are prompting for 6digits and you specified that the requirement is to get a whole number...then change your input to get the number as a whole
cin>>number;
your for loop... |