|
-
March 22nd, 2006, 10:28 PM
#1
working with an array that is a float
/*hi the answer to this is proberly really easy
i am trying to multiply a bit of data from the array by an integer*/
float data[40][7] = {
{1, 20, 1.6, .873, 111, .00608}, /*.....etc*/
deadload = t*(data[j][3]) + c*(data[i][3]);
/*i, j, c and t are all integers deadload is a float the program doesn't error but the output is addresses i think*/
-
March 23rd, 2006, 12:21 AM
#2
Re: data array manipulation
i am not sure what you are tryin to accomplish...... please give more info...
by the way why the brackets areoud the array ???? try this
deadload = (t*data[j][3]) + (c*data[i][3]);
- Sreehari
"Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us."
" Everybody is sent to Earth on a purpose. I am so Lagging behind that i won't die." – Calvin
-
March 23rd, 2006, 12:43 AM
#3
Re: working with an array that is a float
This code is correct. The error must come from somewhere else.
Get this small utility to do basic syntax highlighting in vBulletin forums (like Codeguru) easily.
Supports C++ and VB out of the box, but can be configured for other languages.
-
March 23rd, 2006, 01:01 AM
#4
Re: working with an array that is a float
please dont post multiple threads for the same issue ..
- Sreehari
"Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us."
" Everybody is sent to Earth on a purpose. I am so Lagging behind that i won't die." – Calvin
-
March 23rd, 2006, 02:43 AM
#5
Re: data array manipulation
did u initialize all the variable like i,j etc because by default they are auto and contain garbage value.so u r going to get some garbage value in your result.
Thanx
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|