Search Results

Showing results 1 to 40 of 187
Search took 0.01 seconds.
Search: Posts Made By: joshmo ; Forum: C++ and child forums
Forum: C++ Mar 2nd, 2009
Replies: 1
Views: 261
Posted By joshmo
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
Posted By joshmo
More about it here http://home.att.net/~jackklein/c/inttypes.html
Forum: C++ Oct 21st, 2008
Replies: 3
Views: 492
Posted By joshmo
then you need to use dynamic arrays
Forum: C++ Aug 15th, 2008
Replies: 3
Views: 497
Posted By joshmo
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
Posted By joshmo
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
Posted By joshmo
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
Posted By joshmo
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
Posted By joshmo
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
Solved: C to C++
Views: 436
Posted By joshmo
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
Posted By joshmo
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
Posted By joshmo
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
Posted By joshmo
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
Posted By joshmo
Please use code tags and define your problem clearly
Forum: C++ Jul 24th, 2008
Replies: 13
Views: 4,382
Posted By joshmo
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
Posted By joshmo
Forum: C++ Jul 24th, 2008
Replies: 5
Views: 531
Posted By joshmo
Forum: C++ Jul 7th, 2008
Replies: 13
Solved: help formatting
Views: 1,035
Posted By joshmo
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
Posted By joshmo
Forum: C++ Jun 30th, 2008
Replies: 7
Views: 5,982
Posted By joshmo
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
Posted By joshmo
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
Posted By joshmo
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
Solved: Assignment help
Views: 641
Posted By joshmo
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
Solved: Assignment help
Views: 641
Posted By joshmo
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
Posted By joshmo
cout is followed by "<<" and not ">>"..

[EDIT]Check your cout in the while loop
Forum: C++ Jun 25th, 2008
Replies: 3
Views: 501
Posted By joshmo
Thanx for the correction. Thought you would do it all in one go :)
Forum: C++ Jun 25th, 2008
Replies: 3
Views: 501
Posted By joshmo
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
Posted By joshmo
Perhaps output to a file then printing the file :)
Forum: C++ Jun 23rd, 2008
Replies: 10
Views: 711
Posted By joshmo
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
Posted By joshmo
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
Posted By joshmo
Please post the code
Forum: C++ Jun 23rd, 2008
Replies: 8
Views: 851
Posted By joshmo
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
Posted By joshmo
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
Posted By joshmo
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
Posted By joshmo
read this
http://www.daniweb.com/forums/announcement8-2.html
Forum: C++ Jun 21st, 2008
Replies: 11
Views: 1,054
Posted By joshmo
Read some of the suggestions in your other post
Forum: C++ Jun 21st, 2008
Replies: 3
Views: 607
Posted By joshmo
Nice requirements. What would you want us to do wih them?
Forum: C++ Jun 21st, 2008
Replies: 11
Views: 1,054
Posted By joshmo
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
Posted By joshmo
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
Posted By joshmo
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
Posted By joshmo
Yes. you can read more about it here http://www.cplusplus.com/reference/clibrary/cstdio/getc.html
Showing results 1 to 40 of 187

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC