Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/23/05 23:50
Read: times


 
#93805 - array=pointer...?
Responding to: ???'s previous message
I'm not sure, will that really work?

char aaa[4];
should be equivalent to
const char* aaa = malloc(4);
so aaa is a pointer.
long bbb is just a variable.

So, in your case regval should contain address of the integer containing the data, same as (int)(t1val.hilo) or (int)(&t1val.hilo[0])
t1val.regval = t1val.regval + tmpResult; just causes you lose the reference to memory allocated for the array, points the 4 bytes to memory location tmpResult bytes away from the first place, and doesn't add anything to the value you've just written... is that how it os supposed to work?

List of 27 messages in thread
TopicAuthorDate
Unions in C            01/01/70 00:00      
   You miss the point completely...            01/01/70 00:00      
   Easy with Union            01/01/70 00:00      
      You can see from the Raghu example...            01/01/70 00:00      
         Platform-dependence            01/01/70 00:00      
            Padding in unions            01/01/70 00:00      
               portability            01/01/70 00:00      
      array=pointer...?            01/01/70 00:00      
         array != pointer            01/01/70 00:00      
         Quirk of C            01/01/70 00:00      
            Read the FAQ            01/01/70 00:00      
               Read the Comment            01/01/70 00:00      
                  Read everything            01/01/70 00:00      
                     Looks the same to me            01/01/70 00:00      
                        This One            01/01/70 00:00      
                        That's the problem            01/01/70 00:00      
                           Good example            01/01/70 00:00      
                              No fun            01/01/70 00:00      
                                 Well...            01/01/70 00:00      
                                 Of course it does!            01/01/70 00:00      
                                    Hmm            01/01/70 00:00      
                        Actually, even less.            01/01/70 00:00      
                           const pointer            01/01/70 00:00      
   O.K you win            01/01/70 00:00      
      Please conclude            01/01/70 00:00      
         Not Exactly            01/01/70 00:00      
         End of wrong stick?            01/01/70 00:00      

Back to Subject List