|
-
April 15th, 2009, 05:10 PM
#1
question about assigning values to a array member.
hello guys,
i have a very simple class:
class A
{
float k[100];
void assignValuesToK()
{
assign(k);
}
};
and a simple function outside the class A:
assign(float *)
{
for(int i=0;i<100;i++)
k[i]=i;
}
the value assignment seems to be ok if i check the k[] inside the function assign().
however, if i want to print the values of the array k[] in a member function of A after i call assignValuesToK(), i saw a bunch of zeros.
whay? this looks very strange to me.
thank you.
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
|