Forum: C++ Mar 2nd, 2009 |
| Replies: 1 Views: 261 I didnt know where to post this but i hope this is the right place. I was wondering how a code in c++ can be used in or with java. i.e if I decided to write a code in C++ that performs processing and... |
Forum: C++ Oct 21st, 2008 |
| Replies: 5 Views: 612 More about it here http://home.att.net/~jackklein/c/inttypes.html |
Forum: C++ Oct 21st, 2008 |
| Replies: 3 Views: 492 then you need to use dynamic arrays |
Forum: C++ Aug 15th, 2008 |
| Replies: 3 Views: 497 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 31st, 2008 |
| Replies: 11 Views: 900 Thanks for the correction. I forgot that you have to declare it in the function in which you are using it and that is why there is no need to pass it by value or reference. |
Forum: C++ Jul 30th, 2008 |
| Replies: 11 Views: 900 The few mistakes i have observed. You need to open the input file stream before actually checking for the status i.e if it exists or not.
Secondly, you do not need to pass the file stream through... |
Forum: C++ Jul 29th, 2008 |
| Replies: 5 Views: 592 Thanks for the correction. I happened to have edited the OP's code without putting in mind the the syntax...I meant to pass on the logic |
Forum: C++ Jul 29th, 2008 |
| Replies: 5 Views: 600 What if you declared the bool status at the begining and if the required task is performed, the status is changed |
Forum: C++ Jul 29th, 2008 |
| Replies: 3 Views: 436 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: 592 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 29th, 2008 |
| Replies: 17 Views: 1,167 Elaborating more on VernonDozier's post, your function call should only contain the paramaters and not them declared. Change your statements that look like this string getWeaponSelection(int&... |
Forum: C++ Jul 29th, 2008 |
| Replies: 4 Views: 515 Why dont you use these kinds of code tags to easily reference your problem "[code], [code=cpp]" |
Forum: C++ Jul 29th, 2008 |
| Replies: 4 Views: 826 Please use code tags and define your problem clearly |
Forum: C++ Jul 24th, 2008 |
| Replies: 13 Views: 4,382 Everyone has a different way of writing their codes. What you may find long may be easy for someone else. I dont think from what you originally wanted pointers would be of alot of help but it can be... |
Forum: C++ Jul 24th, 2008 |
| Replies: 13 Views: 4,382 What didnt you understand? |
Forum: C++ Jul 24th, 2008 |
| Replies: 5 Views: 531 |
Forum: C++ Jul 7th, 2008 |
| Replies: 13 Views: 1,035 What kind of problem are u experiencing with setw()? Did you add the header file "iomanip"? |
Forum: C++ Jul 4th, 2008 |
| Replies: 3 Views: 793 |
Forum: C++ Jun 30th, 2008 |
| Replies: 7 Views: 5,982 You use it after the getline. I dont quite get your question but after find the whitespace then maybe you can read the next line and so on. |
Forum: C++ Jun 29th, 2008 |
| Replies: 7 Views: 5,982 You can add this to your code. word.substr(word.find(' ');
This will read until the whitespace so you can do what you want. Hope that helps |
Forum: C++ Jun 28th, 2008 |
| Replies: 3 Views: 568 You dont seem to show us any effort. But maybe I can give you a clue. Read in numbers and if the number is less than 0 then quit.. |
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 25th, 2008 |
| Replies: 8 Views: 1,802 cout is followed by "<<" and not ">>"..
[EDIT]Check your cout in the while loop |
Forum: C++ Jun 25th, 2008 |
| Replies: 3 Views: 501 Thanx for the correction. Thought you would do it all in one go :) |
Forum: C++ Jun 25th, 2008 |
| Replies: 3 Views: 501 It looks like you are not reading data from the file. You need to read in the data and maybe compare it to the character. Maybe something like this
if(getline(infile,pubcode)=='S');
{
//do... |
Forum: C++ Jun 25th, 2008 |
| Replies: 5 Views: 1,557 Perhaps output to a file then printing the file :) |
Forum: C++ Jun 23rd, 2008 |
| Replies: 10 Views: 711 What kind of help do you need? It looks like you are posting your assignment questions and your not pointing out where you are finding trouble http://www.daniweb.com/forums/announcement8-2.html |
Forum: C++ Jun 23rd, 2008 |
| Replies: 8 Views: 851 Did you remove the stdafx.h? post your updated code here so we can see what you have done |
Forum: C++ Jun 23rd, 2008 |
| Replies: 2 Views: 386 |
Forum: C++ Jun 23rd, 2008 |
| Replies: 8 Views: 851 You need to include<iostream> this is where the cin and cout are found. Also change void main to int main. A main function must always return a value. You need to also change using namespace system... |
Forum: C++ Jun 22nd, 2008 |
| Replies: 10 Views: 835 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 22nd, 2008 |
| Replies: 2 Views: 684 Good indentation of your code would make it easier for you to see your problems. I can see there are so many for loops with no endings(unless your making nested loops which i highly doubt). You can... |
Forum: C++ Jun 21st, 2008 |
| Replies: 3 Views: 607 read this
http://www.daniweb.com/forums/announcement8-2.html |
Forum: C++ Jun 21st, 2008 |
| Replies: 11 Views: 1,054 Read some of the suggestions in your other post |
Forum: C++ Jun 21st, 2008 |
| Replies: 3 Views: 607 Nice requirements. What would you want us to do wih them? |
Forum: C++ Jun 21st, 2008 |
| Replies: 11 Views: 1,054 well then you would need another for loop in the main function that would move through the player names.
for (int i =1;i <= 12; i++)
{
cout << names[i] << endl;
... |
Forum: C++ Jun 21st, 2008 |
| Replies: 11 Views: 1,054 you need one for loop in your main and I think you need to remove the one in the function. You also need to put the function call before the cout... something like this perhaps
for (int i =1;i <=... |
Forum: C++ Jun 21st, 2008 |
| Replies: 4 Views: 5,644 well you would need two for loops for a 2D array..something like this
for(i=0;i<row;i++)
{
cin>>array[i][0];
for(j=0;j<col;j++)
{
cin>>array[0][j];
}
} |
Forum: C++ Jun 21st, 2008 |
| Replies: 3 Views: 1,870 Yes. you can read more about it here http://www.cplusplus.com/reference/clibrary/cstdio/getc.html |