UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

  • Index
  • » C
  • » size of an array of structure when we are not aware of the structure elements

#1 2009-03-30 10:42 AM

rvan
Member
Registered: 2009-02-27
Posts: 13

Re: size of an array of structure when we are not aware of the structure elements

Hi All,

is it possible to find out the size of an array of structures ( without using 'sizeof' operator). The condition is we have the array of structure instant but we are not aware of the elements inside the structure.

Can someone help me out?


Thanks in advance.

Offline

#2 2009-03-30 12:19 PM

RobSeace
Administrator
From: Boston, MA
Registered: 2002-06-12
Posts: 3,839
Website

Re: size of an array of structure when we are not aware of the structure elements

I'm really not sure what you mean...  How can you not know the structure elements?
Do you mean you just have some opaque reference to it, like a void* pointer, or some
alias struct (eg: like struct sockaddr vs. the real sockaddr_* structs)?

Basically, can you provide more details about exactly what your situation is...  Preferably
with some code snippets to show what you mean...

Offline

#3 2009-09-11 11:10 AM

sxf8974#
Guest

Re: size of an array of structure when we are not aware of the structure elements

  • Index
  • » C
  • » size of an array of structure when we are not aware of the structure elements

Board footer

Powered by FluxBB