Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. DanWiFi

    __attribute__((packed)) -- what is that?

    ok I have a structure: struct dhcp_ippacket_t { struct dhcp_ethhdr_t ethh; struct dhcp_iphdr_t iph; uint8_t payload[DHCP_IP_PLEN]; } __attribute__((packed)); this struct is fed to a call to recv as the buffer to fill (or rather a pointer to it is). What I don't get is what does this...
  2. DanWiFi

    Changing types???

    ok I am a total newbie to this so don't laugh too hard. :) That said: I have a uint32 called daddr. it holds the uint32 representation of an ip address. I need to pass it to a function that takes: Function_One(struct in_addr *ipaddr) How would I convert that so that I can pass it in? Thanks...
  3. DanWiFi

    Pointers/Structures/Functions - LOST :(

    ahh ok that makes all the warnings go away. I still have a problem where when i run the code, I get a segmentation fault or a bus error (seems to be random which one appears) on the call to the third function. Would you be able to take a look at my code if I sent it to you? I know I am asking...
  4. DanWiFi

    Pointers/Structures/Functions - LOST :(

    ahh ok - I do understand, but I think I am missing something. When I use the pointer to pointer code method below, I receive "warning: passing argument 1 of Second_Function from incompatible pointer type" struct dpool_t *dpa; First_Function(&dpa); First_Function(struct dpool_t **dpaOne) {...
  5. DanWiFi

    Pointers/Structures/Functions - LOST :(

    hmm ok that makes sense - but why would one use the more complicated double pointer method over the easier single pointer method? I am doing all of this because, using the code above that I gave you, I need to pass struct dpool_t *dpa down two functions, andthen pass a single pointer to a...
  6. DanWiFi

    Pointers/Structures/Functions - LOST :(

    My functions don't return anything because this is just example code not real code. I am trying to emulate someone else's code. Let me show you the real code that they are using: /* in the test.h area they have: */ struct dpoolm_t; /* Forward declaration */ /* create the...
  7. DanWiFi

    Pointers/Structures/Functions - LOST :(

    Hi guys, I must admit I am sort of a newbie to C, so bear with me. I have this pointer to a structure: struct pool *dpa; declared outside of main (making it global, I believe). now I need to pass this pointer down 3 functions where the third function will need to mess with the data in the...

Part and Inventory Search

Back
Top